Skip to content

Commit

Permalink
adds the "type indicators" cases
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hornig committed Jun 16, 2019
1 parent 46377aa commit 00cec7f
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,36 @@ def main(filename):
print("qr found in", file, parsed)

#do stuff now...

## type indicator cases
if parsed.find("/n/") > -1:
print("type indicator: n/ = OSM Node ID with Basis 64")

if parsed.find("/w/") > -1:
print("type indicator: w/ = OSM Way ID with Basis 64")

if parsed.find("/a/") > -1:
print("type indicator: a/ = OSM Area ID with Basis 64")

if parsed.find("/r/") > -1:
print("type indicator: r/ = OSM Relation ID with Basis 64")

if parsed.find("/g/") > -1:
print("type indicator: g/ = OSM Shortlink quadtiles format")

my_gcp_id = parsed
# when the local id was found with a type indicator, it will be replaced.
# otherwise the parsed text will directly be used in the next "simple locally defined payload" method.

if parsed.find("/l/") > -1:
print("type indicator: l/ = locally defined payload")
my_gcp_id = parsed.split("l/")[1]
print("gcp id", my_gcp_id, "in the local my_gcp_list.txt")


## simple locally defined payloads
for item in gcp_list:
if parsed == item[0]:
if my_gcp_id == item[0]:
print("\t found a known gcp (", item[1] ,"/", item[2] ,"/", item[3] ,") from your list")
location_utm = utm.from_latlon(float(item[1]), float(item[2]))

Expand Down

0 comments on commit 00cec7f

Please sign in to comment.