don't show links originating from offline routers

mainly because the neighbour positions might be outdated
This commit is contained in:
Dominik Heidler 2015-11-19 14:16:12 +01:00
parent b5b4ff60fe
commit a6dad73b91
1 changed files with 8 additions and 1 deletions

View File

@ -32,7 +32,14 @@ def update_mapnik_csv():
with open(os.path.join(CONFIG["csv_dir"], "links.csv"), "w") as csv:
csv.write("WKT,quality\n")
for router in db.routers.find({"position.coordinates": {"$exists": True}, "neighbours": {"$exists": True}}, {"position": 1, "neighbours": 1}):
for router in db.routers.find(
{
"position.coordinates": {"$exists": True},
"neighbours": {"$exists": True},
"status": "online"
},
{"position": 1, "neighbours": 1}
):
for neighbour in router["neighbours"]:
if "position" in neighbour:
csv.write("\"LINESTRING (%f %f,%f %f)\",%i\n" % (