Merge branch 'master' into zlw-drop-name-underscore-highway

pull/1474/head
Brian Sperlongano 2023-01-19 22:58:48 -05:00 zatwierdzone przez GitHub
commit 7cff422290
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
8 zmienionych plików z 59 dodań i 20 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -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:

Wyświetl plik

@ -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);

Wyświetl plik

@ -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:

Wyświetl plik

@ -327,6 +327,8 @@ def_poi_fields: &poi_fields
type: id
- name: geometry
type: geometry
- name: area
type: area
- name: name
key: name
type: string

Wyświetl plik

@ -68,20 +68,6 @@ FROM (
-- etldoc: osm_poi_polygon -> layer_poi:z12
-- etldoc: osm_poi_polygon -> layer_poi:z13
SELECT *,
NULL::integer AS agg_stop,
CASE
WHEN osm_id < 0 THEN -osm_id * 10 + 4
ELSE osm_id * 10 + 1
END AS osm_id_hash
FROM osm_poi_polygon
WHERE geometry && bbox
AND zoom_level BETWEEN 12 AND 13
AND ((subclass = 'station' AND mapping_key = 'railway')
OR subclass IN ('halt', 'ferry_terminal'))
UNION ALL
-- etldoc: osm_poi_polygon -> layer_poi:z14_
SELECT *,
NULL::integer AS agg_stop,
@ -90,8 +76,21 @@ FROM (
ELSE osm_id * 10 + 1
END AS osm_id_hash
FROM osm_poi_polygon
WHERE geometry && bbox
AND zoom_level >= 14
WHERE geometry && bbox AND
CASE
WHEN zoom_level >= 14 THEN TRUE
WHEN zoom_level >= 12 AND
((subclass = 'station' AND mapping_key = 'railway')
OR subclass IN ('halt', 'ferry_terminal')) THEN TRUE
WHEN zoom_level BETWEEN 10 AND 14 THEN
subclass IN ('university', 'college') AND
POWER(4,zoom_level)
-- Compute percentage of the earth's surface covered by this feature (approximately)
-- The constant below is 111,842^2 * 180 * 180, where 111,842 is the length of one degree of latitude at the equator in meters.
* area / (405279708033600 * COS(ST_Y(ST_Transform(geometry,4326))*PI()/180))
-- Match features that are at least 10% of a tile at this zoom
> 0.10
ELSE FALSE END
) AS poi_union
ORDER BY "rank"
$$ LANGUAGE SQL STABLE

Wyświetl plik

@ -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

Wyświetl plik

@ -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: