]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Parse car_parking.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 12 Dec 2021 15:39:44 +0000 (16:39 +0100)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 12 Dec 2021 15:39:44 +0000 (16:39 +0100)
bots/sledrun_wikitext_to_json.py

index e2a6c5393265fe6c3fba103d500fb2d82c1975ba..8827f2bd1f8a87f6069d7f29ff303281ff36a77b 100644 (file)
@@ -241,7 +241,15 @@ class SledrunWikiTextToJsonBot(
                     if x:
                         sledrun_json["car_description"] = str(x)
                         break
-                break
+                x = []
+                for w in v.ifilter_templates(matches='Parkplatz'):
+                    za = str_or_none(w.get(1, None))
+                    zb = str_or_none(w.get(2, None))
+                    z = lonlat_ele_to_json(opt_lonlat_from_str(za), opt_uint_from_str(zb))
+                    if len(z) > 0:
+                        x.append({'position': z})
+                if len(x) > 0:
+                    sledrun_json['car_parking'] = x
 
             x = []
             for v in wikicode.get_sections(levels=[2], matches='Allgemeines'):