forked from hans/Nominatim
prefer local data over fallback for country codes
This commit is contained in:
@@ -495,6 +495,12 @@ BEGIN
|
|||||||
|
|
||||||
--DEBUG: RAISE WARNING 'get_country_code, start: %', ST_AsText(place_centre);
|
--DEBUG: RAISE WARNING 'get_country_code, start: %', ST_AsText(place_centre);
|
||||||
|
|
||||||
|
-- Try for a OSM polygon
|
||||||
|
FOR nearcountry IN select country_code from location_area_country where country_code is not null and not isguess and st_covers(geometry, place_centre) limit 1
|
||||||
|
LOOP
|
||||||
|
RETURN nearcountry.country_code;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
--DEBUG: RAISE WARNING 'osm fallback: %', ST_AsText(place_centre);
|
--DEBUG: RAISE WARNING 'osm fallback: %', ST_AsText(place_centre);
|
||||||
|
|
||||||
-- Try for OSM fallback data
|
-- Try for OSM fallback data
|
||||||
@@ -504,12 +510,6 @@ BEGIN
|
|||||||
RETURN nearcountry.country_code;
|
RETURN nearcountry.country_code;
|
||||||
END LOOP;
|
END LOOP;
|
||||||
|
|
||||||
-- Try for a OSM polygon
|
|
||||||
FOR nearcountry IN select country_code from location_area_country where country_code is not null and not isguess and st_covers(geometry, place_centre) limit 1
|
|
||||||
LOOP
|
|
||||||
RETURN nearcountry.country_code;
|
|
||||||
END LOOP;
|
|
||||||
|
|
||||||
--DEBUG: RAISE WARNING 'natural earth: %', ST_AsText(place_centre);
|
--DEBUG: RAISE WARNING 'natural earth: %', ST_AsText(place_centre);
|
||||||
|
|
||||||
-- Natural earth data
|
-- Natural earth data
|
||||||
|
|||||||
Reference in New Issue
Block a user