From 1df3f53dc10b5909ddcb179df5b60de109efdf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Fo=C5=A1n=C3=A1r?= Date: Sun, 6 Oct 2024 23:55:32 +0200 Subject: [PATCH] remove items overlapping with standard OMT --- layers/exploration/exploration.yaml | 9 +++----- layers/exploration/layer.sql | 4 ++-- layers/exploration/mapping.yaml | 35 +++++++---------------------- 3 files changed, 13 insertions(+), 35 deletions(-) diff --git a/layers/exploration/exploration.yaml b/layers/exploration/exploration.yaml index a222dbd..54b7024 100644 --- a/layers/exploration/exploration.yaml +++ b/layers/exploration/exploration.yaml @@ -7,16 +7,13 @@ layer: class: subclass: name: - description: - website: - wikidata: - wikipedia: - inscription: memorial: datasource: + key_field: osm_id + key_field_as_attribute: no geometry_field: geometry srid: 900913 - query: (SELECT geometry, class, subclass, name, description, website, wikidata, wikipedia, inscription, memorial FROM layer_exploration(!bbox!, z(!scale_denominator!))) AS t + query: (SELECT osm_id, geometry, class, subclass, name, memorial FROM layer_exploration(!bbox!, z(!scale_denominator!))) AS t schema: - ./layer.sql datasources: diff --git a/layers/exploration/layer.sql b/layers/exploration/layer.sql index d7d137c..a53ae2a 100644 --- a/layers/exploration/layer.sql +++ b/layers/exploration/layer.sql @@ -1,6 +1,6 @@ CREATE OR REPLACE FUNCTION layer_exploration(bbox geometry, zoom_level int) -RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, name text, description text, website text, wikidata text, wikipedia text, inscription text, memorial text) AS $$ - SELECT osm_id, geometry, class, subclass, NULLIF(name, '') AS name, NULLIF(description, '') AS description, NULLIF(website, '') AS website, NULLIF(wikidata, '') AS wikidata, NULLIF(wikipedia, '') AS wikipedia, NULLIF(inscription, '') AS inscription, NULLIF(memorial, '') AS memorial +RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, name text, memorial text) AS $$ + SELECT osm_id * 10 + 1, geometry, class, subclass, NULLIF(name, '') AS name, NULLIF(memorial, '') AS memorial FROM osm_exploration_point WHERE zoom_level >= 14 AND geometry && bbox; $$ LANGUAGE SQL IMMUTABLE; diff --git a/layers/exploration/mapping.yaml b/layers/exploration/mapping.yaml index b99ae2f..e84e83c 100644 --- a/layers/exploration/mapping.yaml +++ b/layers/exploration/mapping.yaml @@ -1,3 +1,5 @@ +# can't overlap with https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/mapping.yaml + tables: # etldoc: imposm3 -> osm_exploration_point exploration_point: @@ -14,38 +16,17 @@ tables: - key: name name: name type: string - - key: description - name: description - type: string - - key: website - name: website - type: string - - key: wikidata - name: wikidata - type: string - - key: wikipedia - name: wikipedia - type: string - - key: inscription - name: inscription - type: string - key: memorial name: memorial type: string + - key: tourism + name: tourism + type: string mapping: historic: - - castle - memorial - - monument - - ruins military: - bunker - tourism: - - artwork - - attraction - - viewpoint - information: - - board - - map - - tactile_map - - tactile_model + filters: + reject: + tourism: [__any__]