Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cemetery tagged as grave_yard #1175

Merged
merged 3 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions layers/landuse/class.sql
Original file line number Diff line number Diff line change
@@ -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;
$$;
5 changes: 3 additions & 2 deletions layers/landuse/landuse.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ AS
$$
SELECT osm_id,
geometry,
COALESCE(
landuse_unify(
COALESCE(
NULLIF(landuse, ''),
NULLIF(amenity, ''),
NULLIF(leisure, ''),
NULLIF(tourism, ''),
NULLIF(place, ''),
NULLIF(waterway, '')
) AS class
)) AS class
FROM (
-- etldoc: ne_50m_urban_areas_gen_z4 -> layer_landuse:z4
SELECT osm_id,
Expand Down
1 change: 1 addition & 0 deletions layers/landuse/landuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ layer:
geometry_field: geometry
query: (SELECT geometry, class FROM layer_landuse(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./class.sql
- ./landuse.sql
datasources:
- type: imposm3
Expand Down
1 change: 1 addition & 0 deletions layers/landuse/mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ tables:
- college
- library
- hospital
- grave_yard
leisure:
- stadium
- pitch
Expand Down
Binary file modified layers/landuse/mapping_diagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.