Refactor schema, one _gen_z view per zoom. (#1045)
* Refactor layer aeroway. * Refactor layer boundary. * Refactor layer landcover. * Refactor layer landuse. * Refactor layer park. * Refactor layer transportation. * Refactor layer water. * Refactor layer waterway. * Re-generate water* layers etl_diagrams. * Regenerate etl_diagrams for waterway. * Cast NULL to text.
This commit is contained in:
@@ -12,19 +12,19 @@ AS
|
||||
$$
|
||||
SELECT geometry, aeroway AS class, ref
|
||||
FROM (
|
||||
-- etldoc: osm_aeroway_linestring_gen3 -> layer_aeroway:z10
|
||||
-- etldoc: osm_aeroway_linestring_gen_z10 -> layer_aeroway:z10
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_linestring_gen3
|
||||
FROM osm_aeroway_linestring_gen_z10
|
||||
WHERE zoom_level = 10
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_linestring_gen2 -> layer_aeroway:z11
|
||||
-- etldoc: osm_aeroway_linestring_gen_z11 -> layer_aeroway:z11
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_linestring_gen2
|
||||
FROM osm_aeroway_linestring_gen_z11
|
||||
WHERE zoom_level = 11
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_linestring_gen1 -> layer_aeroway:z12
|
||||
-- etldoc: osm_aeroway_linestring_gen_z12 -> layer_aeroway:z12
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_linestring_gen1
|
||||
FROM osm_aeroway_linestring_gen_z12
|
||||
WHERE zoom_level = 12
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_linestring -> layer_aeroway:z13
|
||||
@@ -33,21 +33,24 @@ FROM (
|
||||
FROM osm_aeroway_linestring
|
||||
WHERE zoom_level >= 13
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_aeroway_polygon_gen3 -> layer_aeroway:z10
|
||||
-- etldoc: osm_aeroway_polygon_gen3 -> layer_aeroway:z11
|
||||
-- etldoc: osm_aeroway_polygon_gen_z10 -> layer_aeroway:z10
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_polygon_gen3
|
||||
WHERE zoom_level BETWEEN 10 AND 11
|
||||
FROM osm_aeroway_polygon_gen_z10
|
||||
WHERE zoom_level = 10
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_polygon_gen2 -> layer_aeroway:z12
|
||||
-- etldoc: osm_aeroway_polygon_gen_z11 -> layer_aeroway:z11
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_polygon_gen2
|
||||
FROM osm_aeroway_polygon_gen_z11
|
||||
WHERE zoom_level = 11
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_polygon_gen_z12 -> layer_aeroway:z12
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_polygon_gen_z12
|
||||
WHERE zoom_level = 12
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_polygon_gen1 -> layer_aeroway:z13
|
||||
-- etldoc: osm_aeroway_polygon_gen_z13 -> layer_aeroway:z13
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_polygon_gen1
|
||||
FROM osm_aeroway_polygon_gen_z13
|
||||
WHERE zoom_level = 13
|
||||
UNION ALL
|
||||
-- etldoc: osm_aeroway_polygon -> layer_aeroway:z14_
|
||||
@@ -58,7 +61,7 @@ FROM (
|
||||
|
||||
-- etldoc: osm_aeroway_point -> layer_aeroway:z14_
|
||||
SELECT geometry, aeroway, ref
|
||||
FROM osm_aeroway_point
|
||||
FROM osm_aeroway_point
|
||||
WHERE zoom_level >= 14
|
||||
) AS zoom_levels
|
||||
WHERE geometry && bbox;
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 166 KiB |
@@ -1,34 +1,40 @@
|
||||
generalized_tables:
|
||||
# etldoc: imposm3 -> osm_aeroway_linestring_gen3
|
||||
aeroway_linestring_gen3:
|
||||
source: aeroway_linestring_gen2
|
||||
# etldoc: osm_aeroway_linestring_gen_z11 -> osm_aeroway_linestring_gen_z10
|
||||
aeroway_linestring_gen_z10:
|
||||
source: aeroway_linestring_gen_z11
|
||||
tolerance: ZRES11
|
||||
|
||||
# etldoc: imposm3 -> osm_aeroway_linestring_gen2
|
||||
aeroway_linestring_gen2:
|
||||
source: aeroway_linestring_gen1
|
||||
# etldoc: osm_aeroway_linestring_gen_z12 -> osm_aeroway_linestring_gen_z11
|
||||
aeroway_linestring_gen_z11:
|
||||
source: aeroway_linestring_gen_z12
|
||||
tolerance: ZRES12
|
||||
|
||||
# etldoc: imposm3 -> osm_aeroway_linestring_gen1
|
||||
aeroway_linestring_gen1:
|
||||
# etldoc: osm_aeroway_linestring -> osm_aeroway_linestring_gen_z12
|
||||
aeroway_linestring_gen_z12:
|
||||
source: aeroway_linestring
|
||||
sql_filter: ST_IsValid(geometry)
|
||||
tolerance: ZRES13
|
||||
|
||||
# etldoc: imposm3 -> osm_aeroway_polygon_gen3
|
||||
aeroway_polygon_gen3:
|
||||
source: aeroway_polygon_gen2
|
||||
# etldoc: osm_aeroway_polygon_gen_z11 -> osm_aeroway_polygon_gen_z10
|
||||
aeroway_polygon_gen_z10:
|
||||
source: aeroway_polygon_gen_z11
|
||||
sql_filter: area>power(ZRES9,2)
|
||||
tolerance: ZRES10
|
||||
|
||||
# etldoc: osm_aeroway_polygon_gen_z12 -> osm_aeroway_polygon_gen_z11
|
||||
aeroway_polygon_gen_z11:
|
||||
source: aeroway_polygon_gen_z12
|
||||
sql_filter: area>power(ZRES10,2)
|
||||
tolerance: ZRES11
|
||||
|
||||
# etldoc: imposm3 -> osm_aeroway_polygon_gen2
|
||||
aeroway_polygon_gen2:
|
||||
source: aeroway_polygon_gen1
|
||||
# etldoc: osm_aeroway_polygon_gen_z13 -> osm_aeroway_polygon_gen_z12
|
||||
aeroway_polygon_gen_z12:
|
||||
source: aeroway_polygon_gen_z13
|
||||
sql_filter: area>power(ZRES11,2)
|
||||
tolerance: ZRES12
|
||||
|
||||
# etldoc: imposm3 -> osm_aeroway_polygon_gen1
|
||||
aeroway_polygon_gen1:
|
||||
# etldoc: osm_aeroway_polygon -> osm_aeroway_polygon_gen_z13
|
||||
aeroway_polygon_gen_z13:
|
||||
source: aeroway_polygon
|
||||
sql_filter: area>power(ZRES12,2) AND ST_IsValid(geometry)
|
||||
tolerance: ZRES13
|
||||
|
||||
Reference in New Issue
Block a user