Files
nq f56776c88b re-deploying
Signed-off-by: nq <nq>
2026-05-03 16:19:43 +03:00

202 lines
9.6 KiB
Python

#take from previous output
temp = """00234008 21.467285,43.637695,22.038574,44.033203
00234009 21.972656,43.637695,22.543945,44.033203
00234010 22.456055,43.637695,23.027344,44.033203
00234011 22.961426,43.637695,23.532715,44.033203
00234012 23.466797,43.637695,24.038086,44.033203
00234020 21.467285,43.308105,22.038574,43.703613
00234021 21.972656,43.308105,22.543945,43.703613
00234022 22.456055,43.308105,23.027344,43.703613
00234023 22.961426,43.308105,23.532715,43.703613
00234024 23.466797,43.308105,24.038086,43.703613
00234032 21.467285,42.978516,22.038574,43.374023
00234033 21.972656,42.956543,22.543945,43.395996
00234034 22.456055,42.978516,23.027344,43.374023
00234035 22.961426,42.978516,23.532715,43.374023
00234036 23.466797,42.978516,24.038086,43.374023
00234044 21.467285,42.604980,22.038574,43.044434
00234045 21.972656,42.626953,22.543945,43.022461
00234046 22.456055,42.626953,23.027344,43.022461
00234047 22.961426,42.626953,23.532715,43.022461
00234048 23.466797,42.604980,24.038086,43.044434
00234056 21.467285,42.297363,22.038574,42.692871
00234057 21.972656,42.297363,22.543945,42.692871
00234058 22.456055,42.297363,23.027344,42.692871
00234059 22.961426,42.297363,23.532715,42.692871
00234060 23.466797,42.297363,24.038086,42.692871
00234068 21.467285,41.967773,22.038574,42.363281
00234069 21.972656,41.967773,22.543945,42.363281
00234070 22.456055,41.967773,23.027344,42.363281
00234071 22.961426,41.967773,23.532715,42.363281
00234072 23.466797,41.967773,24.038086,42.363281
00234080 21.467285,41.638184,22.038574,42.033691
00234081 21.972656,41.638184,22.543945,42.033691
00234082 22.456055,41.638184,23.027344,42.033691
00234083 22.961426,41.638184,23.532715,42.033691
00234084 23.466797,41.638184,24.038086,42.033691
00234092 21.467285,41.308594,22.038574,41.704102
00234093 21.972656,41.308594,22.543945,41.704102
00234094 22.456055,41.308594,23.027344,41.704102
00234095 22.961426,41.308594,23.532715,41.704102
00234096 23.466797,41.308594,24.038086,41.704102
00234104 21.467285,40.979004,22.038574,41.374512
00234105 21.972656,40.957031,22.543945,41.396484
00234106 22.456055,40.979004,23.027344,41.374512
00234107 22.961426,40.979004,23.532715,41.374512
00234108 23.466797,40.979004,24.038086,41.374512
00234116 21.467285,40.605469,22.038574,41.044922
00234117 21.972656,40.627441,22.543945,41.022949
00234118 22.456055,40.605469,23.027344,41.044922
00234119 22.961426,40.627441,23.532715,41.066895
00234120 23.466797,40.627441,24.038086,41.022949
00235001 23.972168,43.637695,24.543457,44.033203
00235002 24.455566,43.637695,25.026855,44.033203
00235003 24.960938,43.637695,25.532227,44.033203
00235004 25.466309,43.637695,26.037598,44.033203
00235005 25.971680,43.637695,26.542969,44.033203
00235006 26.455078,43.637695,27.026367,44.033203
00235007 26.960449,43.637695,27.531738,44.033203
00235008 27.465820,43.637695,28.037109,44.033203
00235009 27.971191,43.637695,28.542480,44.033203
00235010 28.454590,43.637695,29.025879,44.033203
00235013 23.972168,43.308105,24.543457,43.703613
00235014 24.455566,43.308105,25.026855,43.703613
00235015 24.960938,43.308105,25.532227,43.703613
00235016 25.466309,43.308105,26.037598,43.703613
00235017 25.971680,43.308105,26.542969,43.703613
00235018 26.455078,43.308105,27.026367,43.703613
00235019 26.960449,43.308105,27.531738,43.703613
00235020 27.465820,43.308105,28.037109,43.703613
00235021 27.971191,43.308105,28.542480,43.703613
00235022 28.454590,43.308105,29.025879,43.703613
00235025 23.972168,42.956543,24.543457,43.395996
00235026 24.455566,42.978516,25.026855,43.374023
00235027 24.960938,42.978516,25.532227,43.374023
00235028 25.466309,42.956543,26.037598,43.395996
00235029 25.971680,42.978516,26.542969,43.374023
00235030 26.455078,42.978516,27.026367,43.374023
00235031 26.960449,42.978516,27.531738,43.374023
00235032 27.465820,42.978516,28.037109,43.374023
00235033 27.971191,42.978516,28.542480,43.374023
00235034 28.454590,42.978516,29.025879,43.374023
00235037 23.972168,42.626953,24.543457,43.022461
00235038 24.455566,42.626953,25.026855,43.066406
00235039 24.960938,42.604980,25.532227,43.044434
00235040 25.466309,42.604980,26.037598,43.044434
00235041 25.971680,42.626953,26.542969,43.022461
00235042 26.455078,42.626953,27.026367,43.022461
00235043 26.960449,42.626953,27.531738,43.022461
00235044 27.465820,42.604980,28.037109,43.044434
00235045 27.971191,42.626953,28.542480,43.022461
00235046 28.454590,42.626953,29.025879,43.022461
00235049 23.972168,42.297363,24.543457,42.692871
00235050 24.455566,42.297363,25.026855,42.692871
00235051 24.960938,42.297363,25.532227,42.692871
00235052 25.466309,42.297363,26.037598,42.692871
00235053 25.971680,42.297363,26.542969,42.692871
00235054 26.455078,42.297363,27.026367,42.692871
00235055 26.960449,42.297363,27.531738,42.692871
00235056 27.465820,42.297363,28.037109,42.692871
00235057 27.971191,42.297363,28.542480,42.692871
00235058 28.454590,42.297363,29.025879,42.692871
00235061 23.972168,41.967773,24.543457,42.363281
00235062 24.455566,41.967773,25.026855,42.363281
00235063 24.960938,41.967773,25.532227,42.363281
00235064 25.466309,41.967773,26.037598,42.363281
00235065 25.971680,41.967773,26.542969,42.363281
00235066 26.455078,41.967773,27.026367,42.363281
00235067 26.960449,41.967773,27.531738,42.363281
00235068 27.465820,41.967773,28.037109,42.363281
00235069 27.971191,41.967773,28.542480,42.363281
00235070 28.454590,41.967773,29.025879,42.363281
00235073 23.928223,41.638184,24.543457,42.033691
00235074 24.455566,41.638184,25.026855,42.033691
00235075 24.960938,41.638184,25.532227,42.033691
00235076 25.466309,41.638184,26.037598,42.033691
00235077 25.971680,41.638184,26.542969,42.033691
00235078 26.455078,41.638184,27.026367,42.033691
00235079 26.960449,41.638184,27.531738,42.033691
00235080 27.465820,41.638184,28.037109,42.033691
00235081 27.971191,41.638184,28.542480,42.033691
00235082 28.454590,41.638184,29.025879,42.033691
00235085 23.972168,41.308594,24.543457,41.704102
00235086 24.455566,41.308594,25.026855,41.704102
00235087 24.960938,41.308594,25.532227,41.704102
00235088 25.466309,41.308594,26.037598,41.704102
00235089 25.971680,41.308594,26.542969,41.704102
00235090 26.455078,41.308594,27.026367,41.704102
00235091 26.960449,41.308594,27.531738,41.704102
00235092 27.465820,41.308594,28.037109,41.704102
00235093 27.971191,41.308594,28.542480,41.704102
00235094 28.454590,41.308594,29.025879,41.704102
00235097 23.972168,40.979004,24.543457,41.374512
00235098 24.455566,40.979004,25.026855,41.374512
00235099 24.960938,40.979004,25.532227,41.374512
00235100 25.466309,40.979004,26.037598,41.374512
00235101 25.971680,40.957031,26.542969,41.396484
00235102 26.455078,40.979004,27.026367,41.374512
00235103 26.960449,40.979004,27.531738,41.374512
00235104 27.465820,40.979004,28.037109,41.374512
00235105 27.971191,40.957031,28.542480,41.396484
00235106 28.454590,40.979004,29.025879,41.374512
00235109 23.972168,40.605469,24.543457,41.044922
00235110 24.455566,40.627441,25.026855,41.066895
00235111 24.960938,40.627441,25.532227,41.066895
00235112 25.466309,40.605469,26.037598,41.044922
00235113 25.971680,40.627441,26.542969,41.022949
00235114 26.455078,40.627441,27.026367,41.022949
00235115 26.960449,40.627441,27.531738,41.022949
00235116 27.465820,40.627441,28.037109,41.022949
00235117 27.971191,40.605469,28.542480,41.044922
00235118 28.454590,40.627441,29.025879,41.022949
00334140 21.467285,43.967285,22.038574,44.362793
00334141 21.972656,43.967285,22.543945,44.362793
00334142 22.456055,43.967285,23.027344,44.362793
00334143 22.961426,43.967285,23.532715,44.362793
00334144 23.466797,43.967285,24.038086,44.362793
00335133 23.972168,43.967285,24.543457,44.362793
00335134 24.455566,43.967285,25.026855,44.362793
00335135 24.960938,43.967285,25.532227,44.362793
00335136 25.466309,43.967285,26.037598,44.362793
00335137 25.971680,43.967285,26.542969,44.362793
00335138 26.455078,43.967285,27.026367,44.362793
00335139 26.960449,43.967285,27.531738,44.362793
00335140 27.465820,43.967285,28.037109,44.362793
00335141 27.971191,43.967285,28.542480,44.362793
00335142 28.454590,43.967285,29.025879,44.362793
"""
map_segments = []
for line in temp.split("\n"):
map_segments.append(line.split(" ")[0])
import os,sys,garmin_img_roads
print(len(map_segments))
filepath = r"D:\\maps-bg\\gmapsupp\\gmapsupp.img"
if input(f'Running against {len(map_segments)} and {filepath} [!=y break]')!='y':
exit()
counter = 0
# map_segments = map_segments[50:52]
for msegment in map_segments:
# sys.argv = ['garmin_img_to_osmand_v4.py', filepath, '--mapset',msegment,"--landmarks-csv",f"export_landmarks/landmarks-{msegment}.csv"]
# garmin_img_to_osmand_v4.main()
# print("Parsed ",msegment)
# sys.argv = ['garmin_img_to_osmand.py', filepath, '--mapset',msegment,'--landmarks-csv', f"..\parsed-landmarks\csv-from-stage-1\export-v6-{msegment}.csv", '--include-unnamed','--point-profile','all']
# garmin_img_to_osmand.main()
#python stage-1-read-garmin-img/garmin_img_to_osmand.py 'd:/maps-bg/gmapsupp/gmapsupp.img' --point-profile all --include-unnamed --point-group-by raw_type
sys.argv = ['garmin_img_to_osmand.py', filepath,
'--stage1-module','../stage-1-read-garmin-img/garmin_img_to_osmand.py',
'--mapset', msegment,
'--roads-csv', f"../parsed-landmarks/roads-from-stage-3/export-roads-v3-t1-{msegment}.csv",
'--road-profile', 'all_lines'
]
garmin_img_roads.main()
print(f"[{counter}/{len(map_segments)}] - Parsed {msegment}")
counter = counter + 1