always bind addr:place to place instead of street

If an addr:place is given but no addr:street tag, then bind
the rank 30 object always to a <=25 object, even when there
is none found with the same name.
This commit is contained in:
Sarah Hoffmann
2020-09-03 21:42:00 +02:00
parent caea14d035
commit a8dfbcef44
4 changed files with 40 additions and 18 deletions

View File

@@ -92,7 +92,16 @@ BEGIN
END IF;
IF fallback THEN
IF ST_Area(bbox) < 0.005 THEN
IF addr_street is null and addr_place is not null THEN
-- The address is attached to a place we don't know. Find the
-- nearest place instead.
FOR location IN
SELECT place_id FROM getNearFeatures(poi_partition, bbox, 26, '{}'::INTEGER[])
ORDER BY rank_address DESC, isguess asc, distance LIMIT 1
LOOP
parent_place_id := location.place_id;
END LOOP;
ELSEIF ST_Area(bbox) < 0.005 THEN
-- for smaller features get the nearest road
SELECT getNearestRoadPlaceId(poi_partition, bbox) INTO parent_place_id;
--DEBUG: RAISE WARNING 'Checked for nearest way (%)', parent_place_id;