map: filter inactive hoods
Hoods are only inserted into the database if they are active, inactive hoods are ignored. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
3fb9315888
commit
7ac73ebbdc
|
@ -17,6 +17,9 @@ def update_hoods_v2(mysql):
|
|||
kx_keys = []
|
||||
kx_data = []
|
||||
for kx in hoodskx:
|
||||
if not int(kx["active"]):
|
||||
continue
|
||||
|
||||
kx_keys.append(kx["id"])
|
||||
kx_data.append((kx["id"],kx["name"],kx.get("lat",None),kx.get("lon",None),))
|
||||
|
||||
|
@ -52,6 +55,9 @@ def update_hoods_poly(mysql):
|
|||
mysql.execute("DELETE FROM polyhoods",())
|
||||
|
||||
for kx in hoodskx:
|
||||
if not int(kx["active"]):
|
||||
continue
|
||||
|
||||
for polygon in kx.get("polygons",()):
|
||||
mysql.execute("""
|
||||
INSERT INTO polyhoods (hoodid)
|
||||
|
|
|
@ -247,6 +247,9 @@ def update_mapnik_csv(mysql):
|
|||
with open(os.path.join(CONFIG["csv_dir"], "hood-points-poly.csv"), "w", encoding="UTF-8") as csv:
|
||||
csv.write("lng,lat,name\n")
|
||||
for hood in dbhoodspoly:
|
||||
if not int(hood["active"]):
|
||||
continue
|
||||
|
||||
for polygon in hood.get("polygons",()):
|
||||
avlon = 0
|
||||
avlat = 0
|
||||
|
|
Loading…
Reference in New Issue