layers/transportation/: fix SQL mistakes, modify indices (#321)

pull/677/head
golubev 2019-10-04 14:00:14 +03:00
rodzic 0636466cfd
commit 81c90be19b
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -330,7 +330,7 @@ indoor INT, surface TEXT) AS $$
-- etldoc: osm_highway_polygon -> layer_transportation:z14_
SELECT
osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway,
highway, NULL AS construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
public_transport, NULL AS service,
CASE WHEN man_made IN ('bridge') THEN TRUE
ELSE FALSE

Wyświetl plik

@ -34,18 +34,18 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring AS (
FROM (
SELECT
ST_LineMerge(ST_Collect(geometry)) AS geometry,
highway,
highway, construction,
min(z_order) AS z_order
FROM osm_highway_linestring
WHERE (highway IN ('motorway','trunk', 'primary') OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary'))
AND ST_IsValid(geometry)
group by highway
group by highway, construction
) AS highway_union
);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_geometry_idx
ON osm_transportation_merge_linestring USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_highway_partial_idx
ON osm_transportation_merge_linestring(highway)
ON osm_transportation_merge_linestring(highway, construction)
WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring -> osm_transportation_merge_linestring_gen3
@ -58,7 +58,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen3 AS (
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_geometry_idx
ON osm_transportation_merge_linestring_gen3 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_highway_partial_idx
ON osm_transportation_merge_linestring_gen3(highway)
ON osm_transportation_merge_linestring_gen3(highway, construction)
WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen3 -> osm_transportation_merge_linestring_gen4
@ -71,7 +71,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen4 AS (
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_geometry_idx
ON osm_transportation_merge_linestring_gen4 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_highway_partial_idx
ON osm_transportation_merge_linestring_gen4(highway)
ON osm_transportation_merge_linestring_gen4(highway, construction)
WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen4 -> osm_transportation_merge_linestring_gen5
@ -84,7 +84,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen5 AS (
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_geometry_idx
ON osm_transportation_merge_linestring_gen5 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_highway_partial_idx
ON osm_transportation_merge_linestring_gen5(highway)
ON osm_transportation_merge_linestring_gen5(highway, construction)
WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen5 -> osm_transportation_merge_linestring_gen6
@ -96,7 +96,7 @@ CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen6 AS (
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_geometry_idx
ON osm_transportation_merge_linestring_gen6 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_highway_partial_idx
ON osm_transportation_merge_linestring_gen6(highway)
ON osm_transportation_merge_linestring_gen6(highway, construction)
WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen6 -> osm_transportation_merge_linestring_gen7