Skip to content

Commit

Permalink
fix for problem with "James Bay" in water_name (water label) #1595 (#…
Browse files Browse the repository at this point in the history
…1621)

For important marine points distance between NE and OSM with the same name must by under 50km.
  • Loading branch information
phanecak-maptiler committed Jan 25, 2024
1 parent e29827d commit bb154f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions layers/water_name/update_marine_point.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ $$
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)
(
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
Expand Down

0 comments on commit bb154f4

Please sign in to comment.