From 32e87b496d14cbe994b464f69bdd77a1bd7ba6b7 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 23 Dec 2023 22:37:01 -0500 Subject: [PATCH] Fix seamark_code --- layers/park/class.sql | 3 ++- layers/park/park.sql | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/layers/park/class.sql b/layers/park/class.sql index 3bf90711..f6cf95e0 100644 --- a/layers/park/class.sql +++ b/layers/park/class.sql @@ -1,7 +1,8 @@ -CREATE OR REPLACE FUNCTION park_class(boundary text, leisure text, landuse text, historic text) +CREATE OR REPLACE FUNCTION park_class(boundary text, leisure text, landuse text, historic text, seamark_type text) RETURNS text AS $$ SELECT CASE + WHEN seamark_type <> '' THEN 'marine' WHEN boundary = 'national_park' THEN 'national_park' WHEN leisure = 'nature_reserve' THEN 'nature_reserve' WHEN landuse = 'recreation_ground' THEN 'recreation_ground' diff --git a/layers/park/park.sql b/layers/park/park.sql index 5bbb396f..19c3b6e9 100644 --- a/layers/park/park.sql +++ b/layers/park/park.sql @@ -43,7 +43,8 @@ FROM ( NULL AS leisure, NULL AS landuse, CASE WHEN boundary='aboriginal_lands' THEN boundary END AS boundary, - NULL AS historic + NULL AS historic, + seamark_type FROM osm_park_polygon_dissolve_z4 WHERE zoom_level = 4 AND geometry && bbox @@ -58,7 +59,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z5 WHERE zoom_level = 5 AND geometry && bbox @@ -73,7 +75,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z6 WHERE zoom_level = 6 AND geometry && bbox @@ -88,7 +91,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z7 WHERE zoom_level = 7 AND geometry && bbox @@ -103,7 +107,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z8 WHERE zoom_level = 8 AND geometry && bbox @@ -118,7 +123,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z9 WHERE zoom_level = 9 AND geometry && bbox @@ -133,7 +139,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z10 WHERE zoom_level = 10 AND geometry && bbox @@ -148,7 +155,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z11 WHERE zoom_level = 11 AND geometry && bbox @@ -163,7 +171,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z12 WHERE zoom_level = 12 AND geometry && bbox @@ -178,7 +187,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon_gen_z13 WHERE zoom_level = 13 AND geometry && bbox @@ -193,7 +203,8 @@ FROM ( leisure, landuse, boundary, - historic + historic, + seamark_type FROM osm_park_polygon WHERE zoom_level >= 14 AND geometry && bbox @@ -202,7 +213,7 @@ FROM ( UNION ALL SELECT osm_id, geometry_point AS geometry, - park_class(boundary, leisure, landuse, historic) AS class, + park_class(boundary, leisure, landuse, historic, seamark_type) AS class, name, name_en, name_de,