diff --git a/layers/landcover/landcover.sql b/layers/landcover/landcover.sql index a3549240..3123fc51 100644 --- a/layers/landcover/landcover.sql +++ b/layers/landcover/landcover.sql @@ -22,23 +22,23 @@ $$ LANGUAGE SQL IMMUTABLE; -- etldoc: ne_110m_glaciated_areas -> landcover_z0 CREATE OR REPLACE VIEW landcover_z0 AS ( - SELECT NULL::int AS osm_id, geom AS geometry, NULL AS landuse, 'glacier' AS "natural", NULL::text AS wetland FROM ne_110m_glaciated_areas + SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'glacier'::text AS "natural", NULL::text AS wetland FROM ne_110m_glaciated_areas ); CREATE OR REPLACE VIEW landcover_z2 AS ( -- etldoc: ne_50m_glaciated_areas -> landcover_z2 - SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'glacier' AS "natural", NULL::text AS wetland FROM ne_50m_glaciated_areas + SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'glacier'::text AS "natural", NULL::text AS wetland FROM ne_50m_glaciated_areas UNION ALL -- etldoc: ne_50m_antarctic_ice_shelves_polys -> landcover_z2 - SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'ice_shelf' AS "natural", NULL::text AS wetland FROM ne_50m_antarctic_ice_shelves_polys + SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'ice_shelf'::text AS "natural", NULL::text AS wetland FROM ne_50m_antarctic_ice_shelves_polys ); CREATE OR REPLACE VIEW landcover_z5 AS ( -- etldoc: ne_10m_glaciated_areas -> landcover_z5 - SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'glacier' AS "natural", NULL::text AS wetland FROM ne_10m_glaciated_areas + SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'glacier'::text AS "natural", NULL::text AS wetland FROM ne_10m_glaciated_areas UNION ALL -- etldoc: ne_10m_antarctic_ice_shelves_polys -> landcover_z5 - SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'ice_shelf' AS "natural", NULL::text AS wetland FROM ne_10m_antarctic_ice_shelves_polys + SELECT NULL::bigint AS osm_id, geom AS geometry, NULL::text AS landuse, 'ice_shelf'::text AS "natural", NULL::text AS wetland FROM ne_10m_antarctic_ice_shelves_polys ); CREATE OR REPLACE VIEW landcover_z8 AS ( diff --git a/layers/landuse/landuse.sql b/layers/landuse/landuse.sql index c2cafbac..25361beb 100644 --- a/layers/landuse/landuse.sql +++ b/layers/landuse/landuse.sql @@ -10,20 +10,20 @@ $$ LANGUAGE SQL IMMUTABLE; -- etldoc: ne_50m_urban_areas -> landuse_z4 CREATE OR REPLACE VIEW landuse_z4 AS ( - SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential' AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank + SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank FROM ne_50m_urban_areas WHERE scalerank <= 2 ); -- etldoc: ne_50m_urban_areas -> landuse_z5 CREATE OR REPLACE VIEW landuse_z5 AS ( - SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential' AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank + SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank FROM ne_50m_urban_areas ); -- etldoc: ne_10m_urban_areas -> landuse_z6 CREATE OR REPLACE VIEW landuse_z6 AS ( - SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential' AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank + SELECT NULL::bigint AS osm_id, geom AS geometry, 'residential'::text AS landuse, NULL::text AS amenity, NULL::text AS leisure, NULL::text AS boundary, scalerank FROM ne_10m_urban_areas ); diff --git a/layers/water/water.sql b/layers/water/water.sql index 719e5b54..a6cc0df1 100644 --- a/layers/water/water.sql +++ b/layers/water/water.sql @@ -6,55 +6,55 @@ $$ LANGUAGE SQL IMMUTABLE; CREATE OR REPLACE VIEW water_z0 AS ( -- etldoc: ne_110m_ocean -> water_z0 - SELECT geom, 'ocean' AS class FROM ne_110m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_110m_ocean UNION ALL -- etldoc: ne_110m_lakes -> water_z0 - SELECT geom, 'lake' AS class FROM ne_110m_lakes + SELECT geom, 'lake'::text AS class FROM ne_110m_lakes ); CREATE OR REPLACE VIEW water_z1 AS ( -- etldoc: ne_110m_ocean -> water_z1 - SELECT geom, 'ocean' AS class FROM ne_110m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_110m_ocean UNION ALL -- etldoc: ne_110m_lakes -> water_z1 - SELECT geom, 'lake' AS class FROM ne_110m_lakes + SELECT geom, 'lake'::text AS class FROM ne_110m_lakes ); CREATE OR REPLACE VIEW water_z2 AS ( -- etldoc: ne_50m_ocean -> water_z2 - SELECT geom, 'ocean' AS class FROM ne_50m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_50m_ocean UNION ALL -- etldoc: ne_50m_lakes -> water_z2 - SELECT geom, 'lake' AS class FROM ne_50m_lakes + SELECT geom, 'lake'::text AS class FROM ne_50m_lakes ); CREATE OR REPLACE VIEW water_z4 AS ( -- etldoc: ne_50m_ocean -> water_z4 - SELECT geom, 'ocean' AS class FROM ne_50m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_50m_ocean UNION ALL -- etldoc: ne_50m_lakes -> water_z4 - SELECT geom, 'lake' AS class FROM ne_50m_lakes + SELECT geom, 'lake'::text AS class FROM ne_50m_lakes ); CREATE OR REPLACE VIEW water_z5 AS ( -- etldoc: ne_10m_ocean -> water_z5 - SELECT geom, 'ocean' AS class FROM ne_10m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_10m_ocean UNION ALL -- etldoc: ne_10m_lakes -> water_z5 - SELECT geom, 'lake' AS class FROM ne_10m_lakes + SELECT geom, 'lake'::text AS class FROM ne_10m_lakes ); CREATE OR REPLACE VIEW water_z6 AS ( -- etldoc: ne_10m_ocean -> water_z6 - SELECT geom, 'ocean' AS class FROM ne_10m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_10m_ocean UNION ALL -- etldoc: ne_10m_lakes -> water_z6 - SELECT geom, 'lake' AS class FROM ne_10m_lakes + SELECT geom, 'lake'::text AS class FROM ne_10m_lakes ); CREATE OR REPLACE VIEW water_z7 AS ( -- etldoc: ne_10m_ocean -> water_z7 - SELECT geom, 'ocean' AS class FROM ne_10m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_10m_ocean UNION ALL -- etldoc: osm_water_polygon_gen3 -> water_z7 SELECT geometry AS geom, 'lake' AS class FROM osm_water_polygon_gen3 @@ -62,7 +62,7 @@ CREATE OR REPLACE VIEW water_z7 AS ( CREATE OR REPLACE VIEW water_z8 AS ( -- etldoc: ne_10m_ocean -> water_z8 - SELECT geom, 'ocean' AS class FROM ne_10m_ocean + SELECT geom, 'ocean'::text AS class FROM ne_10m_ocean UNION ALL -- etldoc: osm_water_polygon_gen2 -> water_z8 SELECT geometry AS geom, 'lake' AS class FROM osm_water_polygon_gen2 diff --git a/layers/waterway/waterway.sql b/layers/waterway/waterway.sql index 29cb62c4..f8c3fa16 100644 --- a/layers/waterway/waterway.sql +++ b/layers/waterway/waterway.sql @@ -1,19 +1,19 @@ -- etldoc: ne_110m_rivers_lake_centerlines -> waterway_z3 CREATE OR REPLACE VIEW waterway_z3 AS ( - SELECT geom AS geometry, 'river' AS class FROM ne_110m_rivers_lake_centerlines + SELECT geom AS geometry, 'river'::text AS class FROM ne_110m_rivers_lake_centerlines WHERE featurecla = 'River' ); -- etldoc: ne_50m_rivers_lake_centerlines -> waterway_z4 CREATE OR REPLACE VIEW waterway_z4 AS ( - SELECT geom AS geometry, 'river' AS class FROM ne_50m_rivers_lake_centerlines + SELECT geom AS geometry, 'river'::text AS class FROM ne_50m_rivers_lake_centerlines WHERE featurecla = 'River' ); -- etldoc: ne_10m_rivers_lake_centerlines -> waterway_z6 CREATE OR REPLACE VIEW waterway_z6 AS ( - SELECT geom AS geometry, 'river' AS class FROM ne_10m_rivers_lake_centerlines + SELECT geom AS geometry, 'river'::text AS class FROM ne_10m_rivers_lake_centerlines WHERE featurecla = 'River' );