From f1063497efe41f3a8775048fac91b5799cf636f6 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 24 Sep 2012 20:32:43 +0200 Subject: [PATCH] use rank_address for linking places and boundaries This manages to match up a lot more places and boundaries below city level. --- sql/functions.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.5