Move ne_50m data up one level in admin

pull/399/head
lukasmartinelli 2016-08-12 12:06:53 +02:00
rodzic 4bcfaf6a4f
commit 116f33e0a0
2 zmienionych plików z 5 dodań i 23 usunięć

Wyświetl plik

@ -431,12 +431,8 @@ Layer:
WHERE z(!scale_denominator!) = 0
UNION ALL
SELECT osm_id, geometry, admin_level, disputed, maritime
FROM admin_z1
WHERE z(!scale_denominator!) = 1
UNION ALL
SELECT osm_id, geometry, admin_level, disputed, maritime
FROM admin_z2
WHERE z(!scale_denominator!) = 2
FROM admin_z1toz2
WHERE z(!scale_denominator!) BETWEEN 1 AND 2
UNION ALL
SELECT osm_id, geometry, admin_level, disputed, maritime
FROM admin_z3

Wyświetl plik

@ -2,26 +2,14 @@ CREATE OR REPLACE VIEW admin_z0 AS
SELECT 0 AS osm_id, geom AS geometry, 2 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_110m_admin_0_boundary_lines_land;
CREATE OR REPLACE VIEW admin_z1 AS
CREATE OR REPLACE VIEW admin_z1toz2 AS
SELECT 0 AS osm_id, geom AS geometry, 2 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_110m_admin_0_boundary_lines_land
FROM ne_50m_admin_0_boundary_lines_land
UNION ALL
SELECT 0 AS osm_id, geom AS geometry, 4 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_50m_admin_1_states_provinces_lines
WHERE scalerank = 2;
CREATE OR REPLACE VIEW admin_z2 AS
SELECT 0 AS osm_id, geom AS geometry, 2 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_110m_admin_0_boundary_lines_land
UNION ALL
SELECT id AS osm_id, geometry, admin_level, 0 AS disputed, maritime
FROM osm_admin_linestring
WHERE maritime = 1 AND admin_level = 2
UNION ALL
SELECT 0 AS osm_id, geom AS geometry, 4 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_10m_admin_1_states_provinces_lines_shp
WHERE scalerank = 2;
CREATE OR REPLACE VIEW admin_z3 AS
SELECT 0 AS osm_id, geom AS geometry, 2 AS admin_level, 0 AS disputed, 0 AS maritime
FROM ne_50m_admin_0_boundary_lines_land
@ -69,9 +57,7 @@ CREATE OR REPLACE VIEW admin_z7toz14 AS
CREATE OR REPLACE VIEW admin_layer AS (
SELECT osm_id FROM admin_z0
UNION
SELECT osm_id FROM admin_z1
UNION
SELECT osm_id FROM admin_z2
SELECT osm_id FROM admin_z1toz2
UNION
SELECT osm_id FROM admin_z3
UNION