kopia lustrzana https://github.com/openmaptiles/openmaptiles
Add `boundary=protected_area` parks
@zstadler, thank you for PR. Add `boundary=protected_area` parks No performance impact, a very slight increase in size, but with a very good impact on features completeness. Thankspull/815/head
commit
7f24c099ee
|
@ -6,59 +6,67 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, name text, name_en t
|
|||
SELECT osm_id, geometry, class, name, name_en, name_de, tags, rank
|
||||
FROM (
|
||||
SELECT osm_id, geometry,
|
||||
COALESCE(NULLIF(boundary, ''), NULLIF(leisure, '')) AS class,
|
||||
COALESCE(
|
||||
LOWER(REPLACE(NULLIF(protection_title, ''), ' ', '_')),
|
||||
NULLIF(boundary, ''),
|
||||
NULLIF(leisure, '')
|
||||
) AS class,
|
||||
name, name_en, name_de, tags,
|
||||
NULL::int as rank
|
||||
FROM (
|
||||
-- etldoc: osm_park_polygon_gen8 -> layer_park:z6
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen8
|
||||
WHERE zoom_level = 6 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen7 -> layer_park:z7
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen7
|
||||
WHERE zoom_level = 7 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen6 -> layer_park:z8
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen6
|
||||
WHERE zoom_level = 8 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen5 -> layer_park:z9
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen5
|
||||
WHERE zoom_level = 9 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen4 -> layer_park:z10
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen4
|
||||
WHERE zoom_level = 10 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen3 -> layer_park:z11
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen3
|
||||
WHERE zoom_level = 11 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen2 -> layer_park:z12
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen2
|
||||
WHERE zoom_level = 12 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon_gen1 -> layer_park:z13
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon_gen1
|
||||
WHERE zoom_level = 13 AND geometry && bbox
|
||||
UNION ALL
|
||||
-- etldoc: osm_park_polygon -> layer_park:z14
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary
|
||||
SELECT osm_id, geometry, name, name_en, name_de, tags, leisure, boundary, protection_title
|
||||
FROM osm_park_polygon
|
||||
WHERE zoom_level >= 14 AND geometry && bbox
|
||||
) AS park_polygon
|
||||
|
||||
UNION ALL
|
||||
SELECT osm_id, geometry_point AS geometry,
|
||||
COALESCE(NULLIF(boundary, ''), NULLIF(leisure, '')) AS class,
|
||||
COALESCE(
|
||||
LOWER(REPLACE(NULLIF(protection_title, ''), ' ', '_')),
|
||||
NULLIF(boundary, ''),
|
||||
NULLIF(leisure, '')
|
||||
) AS class,
|
||||
name, name_en, name_de, tags,
|
||||
row_number() OVER (
|
||||
PARTITION BY LabelGrid(geometry_point, 100 * pixel_width)
|
||||
|
@ -69,55 +77,55 @@ RETURNS TABLE(osm_id bigint, geometry geometry, class text, name text, name_en t
|
|||
)::int AS "rank"
|
||||
FROM (
|
||||
-- etldoc: osm_park_polygon_gen8 -> layer_park:z6
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen8
|
||||
WHERE zoom_level = 6 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen7 -> layer_park:z7
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen7
|
||||
WHERE zoom_level = 7 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen6 -> layer_park:z8
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen6
|
||||
WHERE zoom_level = 8 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen5 -> layer_park:z9
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen5
|
||||
WHERE zoom_level = 9 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen4 -> layer_park:z10
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen4
|
||||
WHERE zoom_level = 10 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen3 -> layer_park:z11
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen3
|
||||
WHERE zoom_level = 11 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen2 -> layer_park:z12
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen2
|
||||
WHERE zoom_level = 12 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon_gen1 -> layer_park:z13
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon_gen1
|
||||
WHERE zoom_level = 13 AND geometry_point && bbox
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_park_polygon -> layer_park:z14
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, area
|
||||
SELECT osm_id, geometry_point, name, name_en, name_de, tags, leisure, boundary, protection_title, area
|
||||
FROM osm_park_polygon
|
||||
WHERE zoom_level >= 14 AND geometry_point && bbox
|
||||
) AS park_point
|
||||
|
|
|
@ -78,6 +78,9 @@ tables:
|
|||
- name: boundary
|
||||
key: boundary
|
||||
type: string
|
||||
- name: protection_title
|
||||
key: protection_title
|
||||
type: string
|
||||
- name: area
|
||||
type: area
|
||||
mapping:
|
||||
|
@ -85,3 +88,4 @@ tables:
|
|||
- nature_reserve
|
||||
boundary:
|
||||
- national_park
|
||||
- protected_area
|
||||
|
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 10 KiB Po Szerokość: | Wysokość: | Rozmiar: 13 KiB |
|
@ -1,15 +1,22 @@
|
|||
layer:
|
||||
id: "park"
|
||||
description: |
|
||||
The park layer contains parks from OpenStreetMap tagged with either [`boundary=national_park`](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dnational_park) or [`leisure=nature_reserve`](http://wiki.openstreetmap.org/wiki/Tag:leisure%3Dnature_reserve).
|
||||
The park layer contains parks from OpenStreetMap tagged with
|
||||
[`boundary=national_park`](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dnational_park),
|
||||
[`boundary=protected_area`](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dprotected_area),
|
||||
or [`leisure=nature_reserve`](http://wiki.openstreetmap.org/wiki/Tag:leisure%3Dnature_reserve).
|
||||
buffer_size: 4
|
||||
fields:
|
||||
class:
|
||||
description: |
|
||||
Use the **class** to differentiate between different parks.
|
||||
values:
|
||||
- national_park
|
||||
- nature_reserve
|
||||
The class for `boundary=protected_area` parks is the lower-case of the
|
||||
[`protection_title`](http://wiki.openstreetmap.org/wiki/key:protection_title)
|
||||
value with blanks replaced by `_`.
|
||||
`national_park` is the class of `protection_title=National Park` and `boundary=national_park`.
|
||||
`nature_reserve` is the class of `protection_title=Nature Reserve` and `leisure=nature_reserve`.
|
||||
The class for other [`protection_title`](http://wiki.openstreetmap.org/wiki/key:protection_title)
|
||||
values is similarly assigned.
|
||||
name: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the park (point features only).
|
||||
name_en: English name `name:en` if available, otherwise `name` (point features only).
|
||||
name_de: German name `name:de` if available, otherwise `name` or `name:en` (point features only).
|
||||
|
|
Ładowanie…
Reference in New Issue