From 168e8300c0e973d12272a3b9501cac34acf36ba1 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 16 Jan 2023 05:33:43 -0500 Subject: [PATCH 1/3] Allow lakelines at native sizes (#1475) This PR reduces the minimum lake line zoom to z3, allowing the largest lakes to show a renderable label. The lakeline function is restricted by the LineLabel() function, which limits lakelines to only those that are big enough to render a text label. Therefore, further restricting lakelines by zoom is not necessary. --- layers/water_name/water_name.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/water_name/water_name.sql b/layers/water_name/water_name.sql index f10dafa7..748b3904 100644 --- a/layers/water_name/water_name.sql +++ b/layers/water_name/water_name.sql @@ -31,7 +31,7 @@ SELECT is_intermittent::int AS intermittent FROM osm_water_lakeline WHERE geometry && bbox - AND ((zoom_level BETWEEN 9 AND 13 AND LineLabel(zoom_level, NULLIF(name, ''), geometry)) + AND ((zoom_level BETWEEN 3 AND 13 AND LineLabel(zoom_level, NULLIF(name, ''), geometry)) OR (zoom_level >= 14)) UNION ALL SELECT From 3b4650fca1feed6f2ff84b69cc4866c59fca6395 Mon Sep 17 00:00:00 2001 From: ttomasz <31594210+ttomasz@users.noreply.github.com> Date: Tue, 17 Jan 2023 09:34:27 +0100 Subject: [PATCH 2/3] Tile duplicate housenumber filtering (#1391) This PR introduces simple filtering of duplicate housenumbers. Simple means that filtering is done withing the tile. Duplicates are defined as same housenumber, street, block_number[1]. Duplicates are usually caused by POIs. People like to add addresses to them. Most POIs have names so to prioritize addresses we pick features without names first. Formula is: `row_number() OVER(PARTITION BY concat(street, block_number, housenumber) ORDER BY has_name ASC) == 1` --- layers/housenumber/housenumber.sql | 16 +++++++++++++--- layers/housenumber/housenumber.yaml | 1 + layers/housenumber/housenumber_centroid.sql | 10 ++++++++++ layers/housenumber/mapping.yaml | 9 +++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/layers/housenumber/housenumber.sql b/layers/housenumber/housenumber.sql index 84cb4d83..54cccef5 100644 --- a/layers/housenumber/housenumber.sql +++ b/layers/housenumber/housenumber.sql @@ -15,9 +15,19 @@ SELECT osm_id, geometry, housenumber -FROM osm_housenumber_point -WHERE zoom_level >= 14 - AND geometry && bbox; +FROM ( + SELECT + osm_id, + geometry, + housenumber, + row_number() OVER(PARTITION BY concat(street, block_number, housenumber) ORDER BY has_name ASC) as rn + FROM osm_housenumber_point + WHERE 1=1 + AND zoom_level >= 14 + AND geometry && bbox +) t +WHERE rn = 1; + $$ LANGUAGE SQL STABLE -- STRICT PARALLEL SAFE; diff --git a/layers/housenumber/housenumber.yaml b/layers/housenumber/housenumber.yaml index e3df8784..7fa1e6e0 100644 --- a/layers/housenumber/housenumber.yaml +++ b/layers/housenumber/housenumber.yaml @@ -3,6 +3,7 @@ layer: description: | Everything in OpenStreetMap which contains a `addr:housenumber` tag useful for labelling housenumbers on a map. This adds significant size to *z14*. For buildings the centroid of the building is used as housenumber. + Duplicates within a tile are dropped if they have the same street/block_number (records without name tag are prioritized for preservation). buffer_size: 8 srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over fields: diff --git a/layers/housenumber/housenumber_centroid.sql b/layers/housenumber/housenumber_centroid.sql index c7a0bf23..66db8a1f 100644 --- a/layers/housenumber/housenumber_centroid.sql +++ b/layers/housenumber/housenumber_centroid.sql @@ -22,6 +22,16 @@ $$ WHERE (full_update OR osm_id IN (SELECT osm_id FROM housenumber.osm_ids)) AND ST_GeometryType(geometry) <> 'ST_Point' AND ST_IsValid(geometry); + + -- we don't need exact name just to know if it's present + UPDATE osm_housenumber_point + SET has_name = + CASE + WHEN has_name = '' THEN '0' + ELSE '1' + END + WHERE (full_update OR osm_id IN (SELECT osm_id FROM housenumber.osm_ids)); + $$ LANGUAGE SQL; SELECT convert_housenumber_point(true); diff --git a/layers/housenumber/mapping.yaml b/layers/housenumber/mapping.yaml index 174335bb..4bb0fbe3 100644 --- a/layers/housenumber/mapping.yaml +++ b/layers/housenumber/mapping.yaml @@ -12,6 +12,15 @@ tables: - name: housenumber key: addr:housenumber type: string + - name: street + key: addr:street + type: string + - name: block_number + key: addr:block_number + type: string + - name: has_name + key: name + type: string type_mappings: points: addr:housenumber: From f9e358c9620ae84f2f26f43dbff067d4e4fb86dc Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Tue, 17 Jan 2023 04:38:31 -0500 Subject: [PATCH 3/3] Add substantial missing languages in the US (#1477) This PR adds eight missing languages, all of which are among the top 25 languages spoken in the United States, as discussed in ZeLonewolf/openstreetmap-americana#586, and have at least 10,000 `name:xx` usages in the database. Additionally, most of these languages are the primary or national language in the countries where they are most commonly spoken. --- openmaptiles.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openmaptiles.yaml b/openmaptiles.yaml index 0758eab8..1f23408b 100644 --- a/openmaptiles.yaml +++ b/openmaptiles.yaml @@ -32,6 +32,7 @@ tileset: - az # Azerbaijani, Latin - be # Belorussian - bg # Bulgarian + - bn # Bengali - br # Breton, Latin - bs # Bosnian, Latin - ca # Catalan, Latin @@ -46,6 +47,7 @@ tileset: - es # Spanish, Latin - et # Estonian, Latin - eu # Basque, Latin + - fa # Persian - fi # Finnish, Latin - fr # French, Latin - fy # Western Frisian, Latin @@ -80,6 +82,8 @@ tileset: - nl # Dutch, Latin - "no" # Norwegian, Latin - oc # Occitan (post 1500), Latin + - pa # Punjabi + - pnb # Western Punjabi - pl # Polish, Latin - pt # Portuguese, Latin - rm # Romansh, Latin @@ -96,7 +100,11 @@ tileset: - th # Thai - tr # Turkish, Latin - uk # Ukrainian + - ur # Urdu + - vi # Vietnamese, Latin - zh # Chinese + - zh-Hant # Traditional Chinese + - zh-Hans # Simplified Chinese defaults: srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over datasource: