Prefer to join NE countries by Wikidata ID

pull/533/head
jirik 2018-11-12 12:13:12 +01:00 zatwierdzone przez Jiri Kozel
rodzic 9c088abd3d
commit 9d07350ac4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -24,9 +24,9 @@ BEGIN
FROM ne_10m_admin_0_countries AS ne, osm_country_point AS osm
WHERE
-- We match only countries with ISO codes to eliminate disputed countries
-- that lies inside polygon of sovereign country
iso3166_1_alpha_2 IS NOT NULL
AND ST_Within(osm.geometry, ne.geometry)
-- that has same Wikidata ID or lies inside polygon of sovereign country
AND (osm.tags->'wikidata' = ne.wikidataid OR ST_Within(osm.geometry, ne.geometry))
)
UPDATE osm_country_point AS osm
-- Normalize both scalerank and labelrank into a ranking system from 1 to 6