fix for problem with "James Bay" in water_name (water label) #1595 (#1621)

For important marine points distance between NE and OSM with the same name must by under 50km.
This commit is contained in:
Peter Hanecak 2024-01-25 16:01:39 +01:00 committed by GitHub
parent e29827d76c
commit bb154f4ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,9 +18,12 @@ $$
SELECT osm.osm_id, ne.scalerank
FROM osm_marine_point AS osm
LEFT JOIN ne_10m_geography_marine_polys AS ne ON
(
lower(trim(regexp_replace(ne.name, '\\s+', ' ', 'g'))) IN (lower(osm.name), lower(osm.tags->'name:en'), lower(osm.tags->'name:es'))
OR substring(lower(trim(regexp_replace(ne.name, '\\s+', ' ', 'g'))) FROM 1 FOR length(lower(osm.name))) = lower(osm.name)
)
AND ST_DWithin(ne.geometry, osm.geometry, 50000)
)
UPDATE osm_marine_point AS osm
SET "rank" = scalerank
FROM important_marine_point AS ne