diff --git a/data.yml b/data.yml index 8ef8b37..bb700e3 100644 --- a/data.yml +++ b/data.yml @@ -125,6 +125,41 @@ Layer: properties: "buffer-size": 4 srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over + - id: ice + Datasource: + dbname: osm + extent: -20037508.34,-20037508.34,20037508.34,20037508.34 + geometry_field: geom + geometry_table: '' + host: db + key_field: '' + key_field_as_attribute: '' + max_size: 512 + password: osm + port: 5432 + srid: '' + table: |- + ( SELECT geom, type + FROM ( + SELECT * FROM ice_z0 + WHERE z(!scale_denominator!) BETWEEN 0 AND 1 + UNION ALL + SELECT * FROM ice_z2 + WHERE z(!scale_denominator!) BETWEEN 2 AND 4 + UNION ALL + SELECT * FROM ice_z5 + WHERE z(!scale_denominator!) BETWEEN 5 AND 7 + ) AS ice + WHERE geom && !bbox! + ) AS t + type: postgis + user: osm + description: Ice shelves + fields: + type: String + properties: + "buffer-size": 4 + srs: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over - id: building Datasource: dbname: osm diff --git a/schema/create_schema.sh b/schema/create_schema.sh index cac0a6e..5407aad 100755 --- a/schema/create_schema.sh +++ b/schema/create_schema.sh @@ -20,6 +20,7 @@ function main() { exec_psql_file "layers/building.sql" exec_psql_file "layers/boundary.sql" exec_psql_file "layers/road.sql" + exec_psql_file "layers/ice.sql" } main diff --git a/schema/layers/ice.sql b/schema/layers/ice.sql new file mode 100644 index 0000000..19dcee0 --- /dev/null +++ b/schema/layers/ice.sql @@ -0,0 +1,15 @@ +CREATE OR REPLACE VIEW ice_z0 AS ( + SELECT geom, 'glacier' AS type FROM ne_110m_glaciated_areas +); + +CREATE OR REPLACE VIEW ice_z2 AS ( + SELECT geom, 'glacier' AS type FROM ne_50m_glaciated_areas + UNION ALL + SELECT geom, 'ice_shelf' AS type FROM ne_50m_antarctic_ice_shelves_polys +); + +CREATE OR REPLACE VIEW ice_z5 AS ( + SELECT geom, 'glacier' AS type FROM ne_10m_glaciated_areas + UNION ALL + SELECT geom, 'ice_shelf' AS type FROM ne_10m_antarctic_ice_shelves_polys +);