kopia lustrzana https://github.com/openmaptiles/openmaptiles
Simplify park classes
rodzic
624cf7a8a3
commit
1282fb1f90
|
@ -0,0 +1,11 @@
|
|||
CREATE OR REPLACE FUNCTION park_class(boundary text, leisure text, landuse text, historic text)
|
||||
RETURNS text AS
|
||||
$$
|
||||
SELECT CASE
|
||||
WHEN boundary = 'national_park' THEN 'national_park'
|
||||
WHEN leisure = 'nature_reserve' THEN 'nature_reserve'
|
||||
WHEN landuse = 'recreation_ground' THEN 'recreation_ground'
|
||||
WHEN historic <> '' THEN 'historic'
|
||||
ELSE 'nature_reserve' END;
|
||||
$$ LANGUAGE SQL IMMUTABLE
|
||||
PARALLEL SAFE;
|
|
@ -90,8 +90,8 @@ tables:
|
|||
- name: boundary
|
||||
key: boundary
|
||||
type: string
|
||||
- name: protection_title
|
||||
key: protection_title
|
||||
- name: historic
|
||||
key: historic
|
||||
type: string
|
||||
- name: area
|
||||
type: area
|
||||
|
@ -101,3 +101,7 @@ tables:
|
|||
boundary:
|
||||
- national_park
|
||||
- protected_area
|
||||
historic:
|
||||
- archaeological_site
|
||||
- battlefield
|
||||
- district
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 13 KiB Po Szerokość: | Wysokość: | Rozmiar: 19 KiB |
|
@ -26,11 +26,7 @@ SELECT osm_id,
|
|||
FROM (
|
||||
SELECT osm_id,
|
||||
geometry,
|
||||
COALESCE(
|
||||
LOWER(REPLACE(NULLIF(protection_title, ''), ' ', '_')),
|
||||
NULLIF(boundary, ''),
|
||||
NULLIF(leisure, '')
|
||||
) AS class,
|
||||
park_class(boundary, leisure, landuse, historic) AS class,
|
||||
name,
|
||||
name_en,
|
||||
name_de,
|
||||
|
@ -45,8 +41,9 @@ FROM (
|
|||
NULL AS name_de,
|
||||
NULL AS tags,
|
||||
NULL AS leisure,
|
||||
NULL AS landuse,
|
||||
NULL AS boundary,
|
||||
NULL AS protection_title
|
||||
NULL AS historic
|
||||
FROM osm_park_polygon_dissolve_z4
|
||||
WHERE zoom_level = 4
|
||||
AND geometry && bbox
|
||||
|
@ -59,8 +56,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z5
|
||||
WHERE zoom_level = 5
|
||||
AND geometry && bbox
|
||||
|
@ -73,8 +71,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z6
|
||||
WHERE zoom_level = 6
|
||||
AND geometry && bbox
|
||||
|
@ -87,8 +86,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z7
|
||||
WHERE zoom_level = 7
|
||||
AND geometry && bbox
|
||||
|
@ -101,8 +101,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z8
|
||||
WHERE zoom_level = 8
|
||||
AND geometry && bbox
|
||||
|
@ -115,8 +116,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z9
|
||||
WHERE zoom_level = 9
|
||||
AND geometry && bbox
|
||||
|
@ -129,8 +131,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z10
|
||||
WHERE zoom_level = 10
|
||||
AND geometry && bbox
|
||||
|
@ -143,8 +146,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z11
|
||||
WHERE zoom_level = 11
|
||||
AND geometry && bbox
|
||||
|
@ -157,8 +161,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z12
|
||||
WHERE zoom_level = 12
|
||||
AND geometry && bbox
|
||||
|
@ -171,8 +176,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon_gen_z13
|
||||
WHERE zoom_level = 13
|
||||
AND geometry && bbox
|
||||
|
@ -185,8 +191,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title
|
||||
historic
|
||||
FROM osm_park_polygon
|
||||
WHERE zoom_level >= 14
|
||||
AND geometry && bbox
|
||||
|
@ -195,11 +202,7 @@ FROM (
|
|||
UNION ALL
|
||||
SELECT osm_id,
|
||||
geometry_point AS geometry,
|
||||
COALESCE(
|
||||
LOWER(REPLACE(NULLIF(protection_title, ''), ' ', '_')),
|
||||
NULLIF(boundary, ''),
|
||||
NULLIF(leisure, '')
|
||||
) AS class,
|
||||
park_class(boundary, leisure, landuse, historic) AS class,
|
||||
name,
|
||||
name_en,
|
||||
name_de,
|
||||
|
@ -220,8 +223,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z5
|
||||
WHERE zoom_level = 5
|
||||
|
@ -237,8 +241,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z6
|
||||
WHERE zoom_level = 6
|
||||
|
@ -254,8 +259,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z7
|
||||
WHERE zoom_level = 7
|
||||
|
@ -271,8 +277,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z8
|
||||
WHERE zoom_level = 8
|
||||
|
@ -288,8 +295,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z9
|
||||
WHERE zoom_level = 9
|
||||
|
@ -305,8 +313,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z10
|
||||
WHERE zoom_level = 10
|
||||
|
@ -322,8 +331,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z11
|
||||
WHERE zoom_level = 11
|
||||
|
@ -339,8 +349,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z12
|
||||
WHERE zoom_level = 12
|
||||
|
@ -356,8 +367,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon_gen_z13
|
||||
WHERE zoom_level = 13
|
||||
|
@ -373,8 +385,9 @@ FROM (
|
|||
name_de,
|
||||
tags,
|
||||
leisure,
|
||||
landuse,
|
||||
boundary,
|
||||
protection_title,
|
||||
historic,
|
||||
area
|
||||
FROM osm_park_polygon
|
||||
WHERE zoom_level >= 14
|
||||
|
|
|
@ -4,19 +4,14 @@ layer:
|
|||
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).
|
||||
[`leisure=nature_reserve`](http://wiki.openstreetmap.org/wiki/Tag:leisure%3Dnature_reserve),
|
||||
or select values of [`historic=*`](http://wiki.openstreetmap.org/wiki/Key:historic).
|
||||
buffer_size: 4
|
||||
fields:
|
||||
class:
|
||||
description: |
|
||||
Use the **class** to differentiate between different parks.
|
||||
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.
|
||||
The class for `boundary=protected_area` parks is one of: `national_park`, `nature_reserve`, `recreation_ground`, or `historic`.
|
||||
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).
|
||||
|
@ -25,6 +20,7 @@ layer:
|
|||
geometry_field: geometry
|
||||
query: (SELECT geometry, class, name, name_en, name_de, {name_languages}, rank FROM layer_park(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
|
||||
schema:
|
||||
- ./class.sql
|
||||
- ./update_park_polygon.sql
|
||||
- ./park.sql
|
||||
datasources:
|
||||
|
|
Ładowanie…
Reference in New Issue