From: Sarah Hoffmann Date: Mon, 24 Sep 2012 18:32:43 +0000 (+0200) Subject: use rank_address for linking places and boundaries X-Git-Tag: v2.0.0~19 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/f1063497efe41f3a8775048fac91b5799cf636f6 use rank_address for linking places and boundaries This manages to match up a lot more places and boundaries below city level. --- diff --git a/sql/functions.sql b/sql/functions.sql index 4b51ed3c..32af414d 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1540,7 +1540,7 @@ BEGIN -- For an admin centre we also want a name match - still not perfect, for example 'new york, new york' -- But that can be fixed by explicitly setting the label in the data IF make_standard_name(NEW.name->'name') = make_standard_name(linkedPlacex.name->'name') - AND NEW.rank_search = linkedPlacex.rank_search THEN + AND NEW.rank_address = linkedPlacex.rank_address THEN -- If we don't already have one use this as the centre point of the geometry @@ -1577,7 +1577,7 @@ BEGIN FOR linkedPlacex IN select placex.* from placex WHERE make_standard_name(name->'name') = make_standard_name(NEW.name->'name') - AND placex.rank_search = NEW.rank_search + AND placex.rank_address = NEW.rank_address AND placex.place_id != NEW.place_id AND placex.osm_type = 'N'::char(1) AND placex.rank_search < 26 AND st_covers(NEW.geometry, placex.geometry)