kopia lustrzana https://github.com/openmaptiles/openmaptiles
Add support for cemetery tagged as grave_yard (#1175)
Fixes #1057 This PR adds `amenity=grave_yard` to the `landuse` layer. A unification function was implemented which encodes all `class=grave_yard` as `class=cemetery` in the tiles, which adds these features for existing users of `class=cemetery` with no change. The unification function can serve as a basis for any other tags that we might want to unify in the `landuse` layer. Tile rendering for an `amenity=grave_yard`. ([Location](https://www.openstreetmap.org/way/857383420))  Tile rendering for a `landuse=cemetery`. ([Location](https://www.openstreetmap.org/way/385779531)) pull/1167/head^2
rodzic
45d825e212
commit
d186856ac5
|
@ -0,0 +1,10 @@
|
||||||
|
-- Unify class names that represent the same type of feature
|
||||||
|
CREATE OR REPLACE FUNCTION landuse_unify(class text) RETURNS text LANGUAGE plpgsql
|
||||||
|
AS
|
||||||
|
$$
|
||||||
|
BEGIN
|
||||||
|
RETURN CASE
|
||||||
|
WHEN class='grave_yard' THEN 'cemetery'
|
||||||
|
ELSE class END;
|
||||||
|
END;
|
||||||
|
$$;
|
|
@ -49,6 +49,7 @@ AS
|
||||||
$$
|
$$
|
||||||
SELECT osm_id,
|
SELECT osm_id,
|
||||||
geometry,
|
geometry,
|
||||||
|
landuse_unify(
|
||||||
COALESCE(
|
COALESCE(
|
||||||
NULLIF(landuse, ''),
|
NULLIF(landuse, ''),
|
||||||
NULLIF(amenity, ''),
|
NULLIF(amenity, ''),
|
||||||
|
@ -56,7 +57,7 @@ SELECT osm_id,
|
||||||
NULLIF(tourism, ''),
|
NULLIF(tourism, ''),
|
||||||
NULLIF(place, ''),
|
NULLIF(place, ''),
|
||||||
NULLIF(waterway, '')
|
NULLIF(waterway, '')
|
||||||
) AS class
|
)) AS class
|
||||||
FROM (
|
FROM (
|
||||||
-- etldoc: ne_50m_urban_areas_gen_z4 -> layer_landuse:z4
|
-- etldoc: ne_50m_urban_areas_gen_z4 -> layer_landuse:z4
|
||||||
SELECT osm_id,
|
SELECT osm_id,
|
||||||
|
|
|
@ -45,6 +45,7 @@ layer:
|
||||||
geometry_field: geometry
|
geometry_field: geometry
|
||||||
query: (SELECT geometry, class FROM layer_landuse(!bbox!, z(!scale_denominator!))) AS t
|
query: (SELECT geometry, class FROM layer_landuse(!bbox!, z(!scale_denominator!))) AS t
|
||||||
schema:
|
schema:
|
||||||
|
- ./class.sql
|
||||||
- ./landuse.sql
|
- ./landuse.sql
|
||||||
datasources:
|
datasources:
|
||||||
- type: imposm3
|
- type: imposm3
|
||||||
|
|
|
@ -88,6 +88,7 @@ tables:
|
||||||
- college
|
- college
|
||||||
- library
|
- library
|
||||||
- hospital
|
- hospital
|
||||||
|
- grave_yard
|
||||||
leisure:
|
leisure:
|
||||||
- stadium
|
- stadium
|
||||||
- pitch
|
- pitch
|
||||||
|
|
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 69 KiB Po Szerokość: | Wysokość: | Rozmiar: 71 KiB |
Ładowanie…
Reference in New Issue