Skip to content

Commit 00cec7f

Browse files
committed
adds the "type indicators" cases
can now detect the different "type indicator" cases. the local case l/ is also directly prepared to be found in the my_gcp_list.text.
1 parent 46377aa commit 00cec7f

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

main.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,36 @@ def main(filename):
6060
print("qr found in", file, parsed)
6161

6262
#do stuff now...
63+
64+
## type indicator cases
65+
if parsed.find("/n/") > -1:
66+
print("type indicator: n/ = OSM Node ID with Basis 64")
67+
68+
if parsed.find("/w/") > -1:
69+
print("type indicator: w/ = OSM Way ID with Basis 64")
70+
71+
if parsed.find("/a/") > -1:
72+
print("type indicator: a/ = OSM Area ID with Basis 64")
73+
74+
if parsed.find("/r/") > -1:
75+
print("type indicator: r/ = OSM Relation ID with Basis 64")
76+
77+
if parsed.find("/g/") > -1:
78+
print("type indicator: g/ = OSM Shortlink quadtiles format")
79+
80+
my_gcp_id = parsed
81+
# when the local id was found with a type indicator, it will be replaced.
82+
# otherwise the parsed text will directly be used in the next "simple locally defined payload" method.
83+
84+
if parsed.find("/l/") > -1:
85+
print("type indicator: l/ = locally defined payload")
86+
my_gcp_id = parsed.split("l/")[1]
87+
print("gcp id", my_gcp_id, "in the local my_gcp_list.txt")
88+
89+
90+
## simple locally defined payloads
6391
for item in gcp_list:
64-
if parsed == item[0]:
92+
if my_gcp_id == item[0]:
6593
print("\t found a known gcp (", item[1] ,"/", item[2] ,"/", item[3] ,") from your list")
6694
location_utm = utm.from_latlon(float(item[1]), float(item[2]))
6795

0 commit comments

Comments
 (0)