From 00cec7f5a2620c6296199c3b48b5c3da4af02d50 Mon Sep 17 00:00:00 2001 From: hornig Date: Sun, 16 Jun 2019 16:53:11 +0200 Subject: [PATCH] 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. --- main.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 050c679..7b4cdd2 100644 --- a/main.py +++ b/main.py @@ -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]))