From 63e0cd904c025619a89bb45f5728f2d8e3ee7904 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 8 May 2021 11:02:18 +0200 Subject: [PATCH] Remove unused code --- web_view.py | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/web_view.py b/web_view.py index a925333..befeebb 100755 --- a/web_view.py +++ b/web_view.py @@ -82,28 +82,6 @@ def check_for_tagged_qid(qid): ) -def get_tagged_qid(qid): - tagged = [] - seen = set() - for cls in (model.Point, model.Polygon, model.Line): - q = cls.query.filter(cls.tags.has_key("wikidata"), cls.tags["wikidata"] == qid) - for osm in q: - if osm.identifier in seen: - continue - seen.add(osm.identifier) - tagged.append( - { - "identifier": osm.identifier, - "url": osm.osm_url, - # 'geoson': osm.geojson(), - "centroid": list(osm.get_centroid()), - "name": osm.name or "[no label]", - } - ) - - return tagged - - def make_envelope(bbox): west, south, east, north = [float(i) for i in bbox.split(",")] return func.ST_MakeEnvelope(west, south, east, north, srid) @@ -364,13 +342,6 @@ def api_osm_objects(): return jsonify(success=True, objects=objects, duration=t1) -@app.route("/api/1/item/Q") -def api_item_detail(item_id): - qid = f"Q{item_id}" - tagged = get_tagged_qid(qid) - return jsonify(qid=qid, tagged=bool(tagged), info=tagged) - - @app.route("/api/1/search") def api_search(): q = request.args["q"]