Merge branch 'master' into bicycle-foot-horse-mtb_scale

This commit is contained in:
Eva Jelinkova 2019-10-31 18:52:12 +01:00 committed by GitHub
commit bdeb6c8b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
48 changed files with 158 additions and 92 deletions

View File

@ -154,7 +154,8 @@ etl-graph:
# generate etl graph for a certain layer, e.g. etl-graph-building, etl-graph-place # generate etl graph for a certain layer, e.g. etl-graph-building, etl-graph-place
etl-graph-%: layers/% build/devdoc etl-graph-%: layers/% build/devdoc
docker run --rm -v $$(pwd):/tileset openmaptiles/openmaptiles-tools generate-etlgraph layers/$*/$*.yaml ./build/devdoc docker run --rm -u $$(id -u $${USER}):$$(id -g $${USER}) -v $$(pwd):/tileset openmaptiles/openmaptiles-tools generate-etlgraph layers/$*/$*.yaml ./build/devdoc
cp ./build/devdoc/etl_$*.png layers/$*/etl_diagram.png
mappingLayers = $(notdir $(patsubst %/mapping.yaml,%, $(wildcard layers/*/mapping.yaml))) # layers with mapping.yaml mappingLayers = $(notdir $(patsubst %/mapping.yaml,%, $(wildcard layers/*/mapping.yaml))) # layers with mapping.yaml
@ -166,7 +167,8 @@ mapping-graph:
@echo 'Valid layers: $(mappingLayers)' @echo 'Valid layers: $(mappingLayers)'
mapping-graph-%: ./layers/%/mapping.yaml build/devdoc mapping-graph-%: ./layers/%/mapping.yaml build/devdoc
docker run --rm -v $$(pwd):/tileset openmaptiles/openmaptiles-tools generate-mapping-graph layers/$*/$*.yaml ./build/devdoc/mapping-diagram-$* docker run --rm -u $$(id -u $${USER}):$$(id -g $${USER}) -v $$(pwd):/tileset openmaptiles/openmaptiles-tools generate-mapping-graph layers/$*/$*.yaml ./build/devdoc/mapping-diagram-$*
cp ./build/devdoc/mapping-diagram-$*.png layers/$*/mapping_diagram.png
# generate all etl and mapping graphs # generate all etl and mapping graphs
generate-devdoc: $(addprefix etl-graph-,$(layers)) $(addprefix mapping-graph-,$(mappingLayers)) generate-devdoc: $(addprefix etl-graph-,$(layers)) $(addprefix mapping-graph-,$(mappingLayers))

View File

@ -27,6 +27,7 @@ You can start from several GL styles supporting the OpenMapTiles vector schema.
- [Klokantech 3D](https://github.com/openmaptiles/klokantech-3d-gl-style) - [Klokantech 3D](https://github.com/openmaptiles/klokantech-3d-gl-style)
- [Fiord Color](https://github.com/openmaptiles/fiord-color-gl-style) - [Fiord Color](https://github.com/openmaptiles/fiord-color-gl-style)
- [Toner](https://github.com/openmaptiles/toner-gl-style) - [Toner](https://github.com/openmaptiles/toner-gl-style)
- [OSM Liberty](https://github.com/maputnik/osm-liberty)
We also ported over our favorite old raster styles (TM2). We also ported over our favorite old raster styles (TM2).
@ -105,6 +106,16 @@ docker-compose run import-lakelines
docker-compose run import-osmborder docker-compose run import-osmborder
``` ```
**[Optional]**
Import latest Wikidata. If an OSM feature has [Key:wikidata](https://wiki.openstreetmap.org/wiki/Key:wikidata), OpenMapTiles check corresponding item in Wikidata and use its [labels](https://www.wikidata.org/wiki/Help:Label) for languages listed in [openmaptiles.yaml](openmaptiles.yaml). So the generated vector tiles includes multi-languages in name field.
Beware that current [Wikidata dump](https://dumps.wikimedia.org/wikidatawiki/entities/latest-all.json.gz) is more than 55GB, it takes time to download and import it. If you just want to have a quickstart on OpenMapTiles, just skip this step.
```bash
make download-wikidata
docker-compose run import-wikidata
```
[Download OpenStreetMap data extracts](http://download.geofabrik.de/) and store the PBF file in the `./data` directory. [Download OpenStreetMap data extracts](http://download.geofabrik.de/) and store the PBF file in the `./data` directory.
```bash ```bash

View File

@ -18,7 +18,7 @@ services:
networks: networks:
- postgres_conn - postgres_conn
import-water: import-water:
image: "openmaptiles/import-water:1.1" image: "openmaptiles/import-water:1.2"
env_file: .env env_file: .env
networks: networks:
- postgres_conn - postgres_conn
@ -68,7 +68,7 @@ services:
- ./build:/mapping - ./build:/mapping
- cache:/cache - cache:/cache
import-sql: import-sql:
image: "openmaptiles/import-sql:0.8" image: "openmaptiles/import-sql:1.0"
env_file: .env env_file: .env
networks: networks:
- postgres_conn - postgres_conn

View File

@ -27,6 +27,8 @@ layer:
ele_ft: Elevation (`ele`) in feets. ele_ft: Elevation (`ele`) in feets.
datasource: datasource:
geometry_field: geometry geometry_field: geometry
key_field: osm_id
key_field_as_attribute: no
srid: 900913 srid: 900913
query: (SELECT osm_id, geometry, name, name_en, name_de, {name_languages}, class, iata, icao, ele, ele_ft FROM layer_aerodrome_label (!bbox!, z(!scale_denominator!), !pixel_width!)) AS t query: (SELECT osm_id, geometry, name, name_en, name_de, {name_languages}, class, iata, icao, ele, ele_ft FROM layer_aerodrome_label (!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
schema: schema:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -21,7 +21,7 @@ CREATE OR REPLACE FUNCTION landcover_class(landuse VARCHAR, "natural" VARCHAR, l
OR leisure IN ('park', 'garden') OR leisure IN ('park', 'garden')
THEN 'grass' THEN 'grass'
WHEN "natural"='wetland' OR wetland IN ('bog', 'swamp', 'wet_meadow', 'marsh', 'reedbed', 'saltern', 'tidalflat', 'saltmarsh', 'mangrove') THEN 'wetland' WHEN "natural"='wetland' OR wetland IN ('bog', 'swamp', 'wet_meadow', 'marsh', 'reedbed', 'saltern', 'tidalflat', 'saltmarsh', 'mangrove') THEN 'wetland'
WHEN "natural"IN ('beach', 'sand') THEN 'sand' WHEN "natural"IN ('beach', 'sand', 'dune') THEN 'sand'
ELSE NULL ELSE NULL
END; END;
$$ LANGUAGE SQL IMMUTABLE; $$ LANGUAGE SQL IMMUTABLE;

View File

@ -29,6 +29,7 @@ layer:
- bare_rock - bare_rock
- beach - beach
- bog - bog
- dune
- farm - farm
- farmland - farmland
- forest - forest

View File

@ -92,6 +92,7 @@ tables:
- scree - scree
- beach - beach
- sand - sand
- dune
leisure: leisure:
- park - park
- garden - garden

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -19,6 +19,8 @@ layer:
rank: Rank of the peak within one tile (starting at 1 that is the most important peak). rank: Rank of the peak within one tile (starting at 1 that is the most important peak).
datasource: datasource:
geometry_field: geometry geometry_field: geometry
key_field: osm_id
key_field_as_attribute: no
srid: 900913 srid: 900913
query: (SELECT osm_id, geometry, name, name_en, name_de, {name_languages}, class, ele, ele_ft, rank FROM layer_mountain_peak(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t query: (SELECT osm_id, geometry, name, name_en, name_de, {name_languages}, class, ele, ele_ft, rank FROM layer_mountain_peak(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
schema: schema:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -30,7 +30,7 @@ $$ LANGUAGE SQL IMMUTABLE;
CREATE OR REPLACE FUNCTION poi_class(subclass TEXT, mapping_key TEXT) CREATE OR REPLACE FUNCTION poi_class(subclass TEXT, mapping_key TEXT)
RETURNS TEXT AS $$ RETURNS TEXT AS $$
SELECT CASE SELECT CASE
WHEN subclass IN ('accessories','antiques','beauty','bed','boutique','camera','carpet','charity','chemist','chocolate','coffee','computer','confectionery','convenience','copyshop','cosmetics','garden_centre','doityourself','erotic','electronics','fabric','florist','frozen_food','furniture','video_games','video','general','gift','hardware','hearing_aids','hifi','ice_cream','interior_decoration','jewelry','kiosk','lamps','mall','massage','motorcycle','mobile_phone','newsagent','optician','outdoor','perfumery','perfume','pet','photo','second_hand','shoes','sports','stationery','tailor','tattoo','ticket','tobacco','toys','travel_agency','watches','weapons','wholesale') THEN 'shop' WHEN subclass IN ('accessories','antiques','beauty','bed','boutique','camera','carpet','charity','chemist','coffee','computer','convenience','copyshop','cosmetics','garden_centre','doityourself','erotic','electronics','fabric','florist','frozen_food','furniture','video_games','video','general','gift','hardware','hearing_aids','hifi','ice_cream','interior_decoration','jewelry','kiosk','lamps','mall','massage','motorcycle','mobile_phone','newsagent','optician','outdoor','perfumery','perfume','pet','photo','second_hand','shoes','sports','stationery','tailor','tattoo','ticket','tobacco','toys','travel_agency','watches','weapons','wholesale') THEN 'shop'
WHEN subclass IN ('townhall','public_building','courthouse','community_centre') THEN 'town_hall' WHEN subclass IN ('townhall','public_building','courthouse','community_centre') THEN 'town_hall'
WHEN subclass IN ('golf','golf_course','miniature_golf') THEN 'golf' WHEN subclass IN ('golf','golf_course','miniature_golf') THEN 'golf'
WHEN subclass IN ('fast_food','food_court') THEN 'fast_food' WHEN subclass IN ('fast_food','food_court') THEN 'fast_food'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -9,7 +9,7 @@ $$ LANGUAGE SQL IMMUTABLE STRICT;
-- The classes for highways are derived from the classes used in ClearTables -- The classes for highways are derived from the classes used in ClearTables
-- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua -- https://github.com/ClearTables/ClearTables/blob/master/transportation.lua
CREATE OR REPLACE FUNCTION highway_class(highway TEXT, public_transport TEXT) RETURNS TEXT AS $$ CREATE OR REPLACE FUNCTION highway_class(highway TEXT, public_transport TEXT, construction TEXT) RETURNS TEXT AS $$
SELECT CASE SELECT CASE
WHEN highway IN ('motorway', 'motorway_link') THEN 'motorway' WHEN highway IN ('motorway', 'motorway_link') THEN 'motorway'
WHEN highway IN ('trunk', 'trunk_link') THEN 'trunk' WHEN highway IN ('trunk', 'trunk_link') THEN 'trunk'
@ -17,9 +17,19 @@ CREATE OR REPLACE FUNCTION highway_class(highway TEXT, public_transport TEXT) RE
WHEN highway IN ('secondary', 'secondary_link') THEN 'secondary' WHEN highway IN ('secondary', 'secondary_link') THEN 'secondary'
WHEN highway IN ('tertiary', 'tertiary_link') THEN 'tertiary' WHEN highway IN ('tertiary', 'tertiary_link') THEN 'tertiary'
WHEN highway IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor' WHEN highway IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor'
WHEN highway IN ('service', 'track') THEN highway
WHEN highway IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') OR public_transport IN ('platform') THEN 'path' WHEN highway IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') OR public_transport IN ('platform') THEN 'path'
WHEN highway = 'raceway' THEN 'raceway' WHEN highway IN ('service', 'track', 'raceway') THEN highway
WHEN highway = 'construction' THEN CASE
WHEN construction IN ('motorway', 'motorway_link') THEN 'motorway_construction'
WHEN construction IN ('trunk', 'trunk_link') THEN 'trunk_construction'
WHEN construction IN ('primary', 'primary_link') THEN 'primary_construction'
WHEN construction IN ('secondary', 'secondary_link') THEN 'secondary_construction'
WHEN construction IN ('tertiary', 'tertiary_link') THEN 'tertiary_construction'
WHEN construction = '' OR construction IN ('unclassified', 'residential', 'living_street', 'road') THEN 'minor_construction'
WHEN construction IN ('pedestrian', 'path', 'footway', 'cycleway', 'steps', 'bridleway', 'corridor') OR public_transport IN ('platform') THEN 'path_construction'
WHEN construction IN ('service', 'track', 'raceway') THEN CONCAT(highway, '_construction')
ELSE NULL
END
ELSE NULL ELSE NULL
END; END;
$$ LANGUAGE SQL IMMUTABLE; $$ LANGUAGE SQL IMMUTABLE;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

After

Width:  |  Height:  |  Size: 491 KiB

View File

@ -12,7 +12,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
SELECT SELECT
osm_id, geometry, osm_id, geometry,
CASE CASE
WHEN NULLIF(highway, '') IS NOT NULL OR NULLIF(public_transport, '') IS NOT NULL THEN highway_class(highway, public_transport) WHEN NULLIF(highway, '') IS NOT NULL OR NULLIF(public_transport, '') IS NOT NULL THEN highway_class(highway, public_transport, construction)
WHEN NULLIF(railway, '') IS NOT NULL THEN railway_class(railway) WHEN NULLIF(railway, '') IS NOT NULL THEN railway_class(railway)
WHEN NULLIF(aerialway, '') IS NOT NULL THEN aerialway WHEN NULLIF(aerialway, '') IS NOT NULL THEN aerialway
WHEN NULLIF(shipway, '') IS NOT NULL THEN shipway WHEN NULLIF(shipway, '') IS NOT NULL THEN shipway
@ -21,7 +21,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
CASE CASE
WHEN railway IS NOT NULL THEN railway WHEN railway IS NOT NULL THEN railway
WHEN (highway IS NOT NULL OR public_transport IS NOT NULL) WHEN (highway IS NOT NULL OR public_transport IS NOT NULL)
AND highway_class(highway, public_transport) = 'path' AND highway_class(highway, public_transport, construction) = 'path'
THEN COALESCE(NULLIF(public_transport, ''), highway) THEN COALESCE(NULLIF(public_transport, ''), highway)
ELSE NULL ELSE NULL
END AS subclass, END AS subclass,
@ -43,7 +43,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_transportation_merge_linestring_gen7 -> layer_transportation:z4 -- etldoc: osm_transportation_merge_linestring_gen7 -> layer_transportation:z4
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -58,7 +58,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_transportation_merge_linestring_gen6 -> layer_transportation:z5 -- etldoc: osm_transportation_merge_linestring_gen6 -> layer_transportation:z5
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -73,7 +73,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_transportation_merge_linestring_gen5 -> layer_transportation:z6 -- etldoc: osm_transportation_merge_linestring_gen5 -> layer_transportation:z6
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -88,7 +88,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_transportation_merge_linestring_gen4 -> layer_transportation:z7 -- etldoc: osm_transportation_merge_linestring_gen4 -> layer_transportation:z7
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -103,7 +103,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_transportation_merge_linestring_gen3 -> layer_transportation:z8 -- etldoc: osm_transportation_merge_linestring_gen3 -> layer_transportation:z8
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -119,7 +119,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_highway_linestring_gen2 -> layer_transportation:z10 -- etldoc: osm_highway_linestring_gen2 -> layer_transportation:z10
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -135,7 +135,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_highway_linestring_gen1 -> layer_transportation:z11 -- etldoc: osm_highway_linestring_gen1 -> layer_transportation:z11
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, NULL AS service, NULL AS public_transport, NULL AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -153,7 +153,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_highway_linestring -> layer_transportation:z14_ -- etldoc: osm_highway_linestring -> layer_transportation:z14_
SELECT SELECT
osm_id, geometry, osm_id, geometry,
highway, NULL AS railway, NULL AS aerialway, NULL AS shipway, highway, construction, NULL AS railway, NULL AS aerialway, NULL AS shipway,
public_transport, service_value(service) AS service, public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, man_made,
layer, layer,
@ -169,12 +169,12 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
FROM osm_highway_linestring FROM osm_highway_linestring
WHERE NOT is_area AND ( WHERE NOT is_area AND (
zoom_level = 12 AND ( zoom_level = 12 AND (
highway_class(highway, public_transport) NOT IN ('track', 'path', 'minor') highway_class(highway, public_transport, construction) NOT IN ('track', 'path', 'minor')
OR highway IN ('unclassified', 'residential') OR highway IN ('unclassified', 'residential')
) AND man_made <> 'pier' ) AND man_made <> 'pier'
OR zoom_level = 13 OR zoom_level = 13
AND ( AND (
highway_class(highway, public_transport) NOT IN ('track', 'path') AND man_made <> 'pier' highway_class(highway, public_transport, construction) NOT IN ('track', 'path') AND man_made <> 'pier'
OR OR
man_made = 'pier' AND NOT ST_IsClosed(geometry) man_made = 'pier' AND NOT ST_IsClosed(geometry)
) )
@ -190,7 +190,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring_gen5 -> layer_transportation:z8 -- etldoc: osm_railway_linestring_gen5 -> layer_transportation:z8
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -206,7 +206,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring_gen4 -> layer_transportation:z9 -- etldoc: osm_railway_linestring_gen4 -> layer_transportation:z9
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel, NULL::boolean AS is_bridge, NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
@ -222,7 +222,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring_gen3 -> layer_transportation:z10 -- etldoc: osm_railway_linestring_gen3 -> layer_transportation:z10
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -236,7 +236,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring_gen2 -> layer_transportation:z11 -- etldoc: osm_railway_linestring_gen2 -> layer_transportation:z11
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -250,7 +250,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring_gen1 -> layer_transportation:z12 -- etldoc: osm_railway_linestring_gen1 -> layer_transportation:z12
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -265,7 +265,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_railway_linestring -> layer_transportation:z14_ -- etldoc: osm_railway_linestring -> layer_transportation:z14_
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, railway, NULL AS aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, railway, NULL AS aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -280,7 +280,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_aerialway_linestring_gen1 -> layer_transportation:z12 -- etldoc: osm_aerialway_linestring_gen1 -> layer_transportation:z12
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, NULL as railway, aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, NULL as railway, aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -294,7 +294,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_aerialway_linestring -> layer_transportation:z14_ -- etldoc: osm_aerialway_linestring -> layer_transportation:z14_
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, NULL as railway, aerialway, NULL AS shipway, NULL AS highway, NULL AS construction, NULL as railway, aerialway, NULL AS shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -307,7 +307,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_shipway_linestring_gen2 -> layer_transportation:z11 -- etldoc: osm_shipway_linestring_gen2 -> layer_transportation:z11
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, NULL AS railway, NULL AS aerialway, shipway, NULL AS highway, NULL AS construction, NULL AS railway, NULL AS aerialway, shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -320,7 +320,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_shipway_linestring_gen1 -> layer_transportation:z12 -- etldoc: osm_shipway_linestring_gen1 -> layer_transportation:z12
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, NULL AS railway, NULL AS aerialway, shipway, NULL AS highway, NULL AS construction, NULL AS railway, NULL AS aerialway, shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -334,7 +334,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_shipway_linestring -> layer_transportation:z14_ -- etldoc: osm_shipway_linestring -> layer_transportation:z14_
SELECT SELECT
osm_id, geometry, osm_id, geometry,
NULL AS highway, NULL AS railway, NULL AS aerialway, shipway, NULL AS highway, NULL AS construction, NULL AS railway, NULL AS aerialway, shipway,
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
@ -352,7 +352,7 @@ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) A
-- etldoc: osm_highway_polygon -> layer_transportation:z14_ -- etldoc: osm_highway_polygon -> layer_transportation:z14_
SELECT SELECT
osm_id, geometry, 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, public_transport, NULL AS service,
CASE WHEN man_made IN ('bridge') THEN TRUE CASE WHEN man_made IN ('bridge') THEN TRUE
ELSE FALSE ELSE FALSE

View File

@ -45,13 +45,13 @@ generalized_tables:
# etldoc: imposm3 -> osm_highway_linestring_gen2 # etldoc: imposm3 -> osm_highway_linestring_gen2
highway_linestring_gen2: highway_linestring_gen2:
source: highway_linestring_gen1 source: highway_linestring_gen1
sql_filter: highway IN ('motorway', 'trunk', 'primary', 'secondary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link') AND NOT is_area sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link')) AND NOT is_area
tolerance: ZRES11 tolerance: ZRES11
# etldoc: imposm3 -> osm_highway_linestring_gen1 # etldoc: imposm3 -> osm_highway_linestring_gen1
highway_linestring_gen1: highway_linestring_gen1:
source: highway_linestring source: highway_linestring
sql_filter: highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') AND NOT is_area AND ST_IsValid(geometry) sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link')) AND NOT is_area AND ST_IsValid(geometry)
tolerance: ZRES12 tolerance: ZRES12
name_field: &name name_field: &name
@ -166,6 +166,9 @@ tables:
- name: highway - name: highway
key: highway key: highway
type: string type: string
- name: construction
key: construction
type: string
- *ref - *ref
- *network - *network
- *z_order - *z_order
@ -207,18 +210,19 @@ tables:
- tertiary_link - tertiary_link
- unclassified - unclassified
- residential - residential
- road
- living_street - living_street
- raceway - road
- track
- service
- path
- cycleway
- bridleway
- footway
- corridor
- pedestrian - pedestrian
- path
- footway
- cycleway
- steps - steps
- bridleway
- corridor
- service
- track
- raceway
- construction
public_transport: public_transport:
- platform - platform
man_made: man_made:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

@ -14,9 +14,10 @@ layer:
fields: fields:
class: class:
description: | description: |
Distinguish between more and less important roads or railways. Distinguish between more and less important roads or railways and roads under construction.
Class is derived from the value of the Class is derived from the value of the
[`highway`](http://wiki.openstreetmap.org/wiki/Key:highway), [`highway`](http://wiki.openstreetmap.org/wiki/Key:highway),
[`construction`](http://wiki.openstreetmap.org/wiki/Key:construction),
[`railway`](http://wiki.openstreetmap.org/wiki/Key:railway), [`railway`](http://wiki.openstreetmap.org/wiki/Key:railway),
[`aerialway`](http://wiki.openstreetmap.org/wiki/Key:aerialway), [`aerialway`](http://wiki.openstreetmap.org/wiki/Key:aerialway),
[`route`](http://wiki.openstreetmap.org/wiki/Key:route) tag (for [`route`](http://wiki.openstreetmap.org/wiki/Key:route) tag (for
@ -33,6 +34,16 @@ layer:
- track - track
- path - path
- raceway - raceway
- motorway_construction
- trunk_construction
- primary_construction
- secondary_construction
- tertiary_construction
- minor_construction
- service_construction
- track_construction
- path_construction
- raceway_construction
- rail - rail
- transit - transit
- cable_car - cable_car

View File

@ -22,84 +22,88 @@ CREATE INDEX IF NOT EXISTS osm_highway_linestring_highway_idx
-- Improve performance of the sql below -- Improve performance of the sql below
CREATE INDEX IF NOT EXISTS osm_highway_linestring_highway_partial_idx CREATE INDEX IF NOT EXISTS osm_highway_linestring_highway_partial_idx
ON osm_highway_linestring(highway) ON osm_highway_linestring(highway)
WHERE highway IN ('motorway','trunk', 'primary'); WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_highway_linestring -> osm_transportation_merge_linestring -- etldoc: osm_highway_linestring -> osm_transportation_merge_linestring
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring AS (
SELECT SELECT
(ST_Dump(geometry)).geom AS geometry, (ST_Dump(geometry)).geom AS geometry,
NULL::bigint AS osm_id, NULL::bigint AS osm_id,
highway, highway, construction,
z_order z_order
FROM ( FROM (
SELECT SELECT
ST_LineMerge(ST_Collect(geometry)) AS geometry, ST_LineMerge(ST_Collect(geometry)) AS geometry,
highway, highway, construction,
min(z_order) AS z_order min(z_order) AS z_order
FROM osm_highway_linestring FROM osm_highway_linestring
WHERE highway IN ('motorway','trunk', 'primary') AND ST_IsValid(geometry) WHERE (highway IN ('motorway','trunk', 'primary') OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary'))
group by highway AND ST_IsValid(geometry)
group by highway, construction
) AS highway_union ) AS highway_union
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_geometry_idx
ON osm_transportation_merge_linestring USING gist(geometry); ON osm_transportation_merge_linestring USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_highway_partial_idx 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'); WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring -> osm_transportation_merge_linestring_gen3 -- etldoc: osm_transportation_merge_linestring -> osm_transportation_merge_linestring_gen3
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen3 AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen3 AS (
SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, highway, z_order SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, highway, construction, z_order
FROM osm_transportation_merge_linestring FROM osm_transportation_merge_linestring
WHERE highway IN ('motorway','trunk', 'primary') WHERE highway IN ('motorway','trunk', 'primary')
OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary')
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_geometry_idx
ON osm_transportation_merge_linestring_gen3 USING gist(geometry); ON osm_transportation_merge_linestring_gen3 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen3_highway_partial_idx 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'); WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen3 -> osm_transportation_merge_linestring_gen4 -- etldoc: osm_transportation_merge_linestring_gen3 -> osm_transportation_merge_linestring_gen4
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen4 AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen4 AS (
SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, highway, z_order SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, highway, construction, z_order
FROM osm_transportation_merge_linestring_gen3 FROM osm_transportation_merge_linestring_gen3
WHERE highway IN ('motorway','trunk', 'primary') AND ST_Length(geometry) > 50 WHERE (highway IN ('motorway','trunk', 'primary') OR highway = 'construction' AND construction IN ('motorway','trunk', 'primary'))
AND ST_Length(geometry) > 50
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_geometry_idx
ON osm_transportation_merge_linestring_gen4 USING gist(geometry); ON osm_transportation_merge_linestring_gen4 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen4_highway_partial_idx 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'); WHERE highway IN ('motorway','trunk', 'primary', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen4 -> osm_transportation_merge_linestring_gen5 -- etldoc: osm_transportation_merge_linestring_gen4 -> osm_transportation_merge_linestring_gen5
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen5 AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen5 AS (
SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, highway, z_order SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, highway, construction, z_order
FROM osm_transportation_merge_linestring_gen4 FROM osm_transportation_merge_linestring_gen4
WHERE highway IN ('motorway','trunk') AND ST_Length(geometry) > 100 WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk'))
AND ST_Length(geometry) > 100
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_geometry_idx
ON osm_transportation_merge_linestring_gen5 USING gist(geometry); ON osm_transportation_merge_linestring_gen5 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen5_highway_partial_idx 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'); WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen5 -> osm_transportation_merge_linestring_gen6 -- etldoc: osm_transportation_merge_linestring_gen5 -> osm_transportation_merge_linestring_gen6
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen6 AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen6 AS (
SELECT ST_Simplify(geometry, 1000) AS geometry, osm_id, highway, z_order SELECT ST_Simplify(geometry, 1000) AS geometry, osm_id, highway, construction, z_order
FROM osm_transportation_merge_linestring_gen5 FROM osm_transportation_merge_linestring_gen5
WHERE highway IN ('motorway','trunk') AND ST_Length(geometry) > 500 WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 500
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_geometry_idx
ON osm_transportation_merge_linestring_gen6 USING gist(geometry); ON osm_transportation_merge_linestring_gen6 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen6_highway_partial_idx 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'); WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_merge_linestring_gen6 -> osm_transportation_merge_linestring_gen7 -- etldoc: osm_transportation_merge_linestring_gen6 -> osm_transportation_merge_linestring_gen7
CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen7 AS ( CREATE MATERIALIZED VIEW osm_transportation_merge_linestring_gen7 AS (
SELECT ST_Simplify(geometry, 2000) AS geometry, osm_id, highway, z_order SELECT ST_Simplify(geometry, 2000) AS geometry, osm_id, highway, construction, z_order
FROM osm_transportation_merge_linestring_gen6 FROM osm_transportation_merge_linestring_gen6
WHERE highway IN ('motorway') AND ST_Length(geometry) > 1000 WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 1000
); );
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen7_geometry_idx CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen7_geometry_idx
ON osm_transportation_merge_linestring_gen7 USING gist(geometry); ON osm_transportation_merge_linestring_gen7 USING gist(geometry);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 KiB

After

Width:  |  Height:  |  Size: 334 KiB

View File

@ -19,9 +19,9 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
when length(coalesce(ref, ''))>0 when length(coalesce(ref, ''))>0
then 'road' then 'road'
end as network, end as network,
highway_class(highway, '') AS class, highway_class(highway, '', construction) AS class,
CASE CASE
WHEN highway IS NOT NULL AND highway_class(highway, '') = 'path' WHEN highway IS NOT NULL AND highway_class(highway, '', construction) = 'path'
THEN highway THEN highway
ELSE NULL ELSE NULL
END AS subclass, END AS subclass,
@ -70,6 +70,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
"tags", "tags",
ref, ref,
highway, highway,
construction,
network, network,
z_order, z_order,
layer, layer,
@ -78,7 +79,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
FROM osm_transportation_name_linestring FROM osm_transportation_name_linestring
WHERE zoom_level = 12 WHERE zoom_level = 12
AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry) AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry)
AND highway_class(highway, '') NOT IN ('minor', 'track', 'path') AND highway_class(highway, '', construction) NOT IN ('minor', 'track', 'path')
AND NOT highway_is_link(highway) AND NOT highway_is_link(highway)
UNION ALL UNION ALL
@ -92,6 +93,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
"tags", "tags",
ref, ref,
highway, highway,
construction,
network, network,
z_order, z_order,
layer, layer,
@ -100,7 +102,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
FROM osm_transportation_name_linestring FROM osm_transportation_name_linestring
WHERE zoom_level = 13 WHERE zoom_level = 13
AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry) AND LineLabel(zoom_level, COALESCE(NULLIF(name, ''), ref), geometry)
AND highway_class(highway, '') NOT IN ('track', 'path') AND highway_class(highway, '', construction) NOT IN ('track', 'path')
UNION ALL UNION ALL
-- etldoc: osm_transportation_name_linestring -> layer_transportation_name:z14_ -- etldoc: osm_transportation_name_linestring -> layer_transportation_name:z14_
@ -113,6 +115,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text,
"tags", "tags",
ref, ref,
highway, highway,
construction,
network, network,
z_order, z_order,
layer, layer,

View File

@ -29,7 +29,7 @@ layer:
- road (default) - road (default)
class: class:
description: | description: |
Distinguish between more and less important roads. Distinguish between more and less important roads and roads under construction.
values: values:
- motorway - motorway
- trunk - trunk
@ -41,6 +41,16 @@ layer:
- track - track
- path - path
- raceway - raceway
- motorway_construction
- trunk_construction
- primary_construction
- secondary_construction
- tertiary_construction
- minor_construction
- service_construction
- track_construction
- path_construction
- raceway_construction
- rail - rail
- transit - transit
subclass: subclass:

View File

@ -24,6 +24,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_network AS (
else hl.ref else hl.ref
end as ref, end as ref,
hl.highway, hl.highway,
hl.construction,
CASE WHEN highway IN ('footway', 'steps') THEN layer CASE WHEN highway IN ('footway', 'steps') THEN layer
ELSE NULL::int ELSE NULL::int
END AS layer, END AS layer,
@ -53,6 +54,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring AS (
tags || get_basic_names(tags, geometry) AS "tags", tags || get_basic_names(tags, geometry) AS "tags",
ref, ref,
highway, highway,
construction,
"level", "level",
layer, layer,
indoor, indoor,
@ -68,6 +70,7 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring AS (
AS "tags", AS "tags",
ref, ref,
highway, highway,
construction,
"level", "level",
layer, layer,
indoor, indoor,
@ -77,56 +80,56 @@ CREATE MATERIALIZED VIEW osm_transportation_name_linestring AS (
WHERE ("rank"=1 OR "rank" is null) WHERE ("rank"=1 OR "rank" is null)
AND (name <> '' OR ref <> '') AND (name <> '' OR ref <> '')
AND NULLIF(highway, '') IS NOT NULL AND NULLIF(highway, '') IS NOT NULL
group by name, name_en, name_de, ref, highway, "level", layer, indoor, network_type group by name, name_en, name_de, ref, highway, construction, "level", layer, indoor, network_type
) AS highway_union ) AS highway_union
); );
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_geometry_idx ON osm_transportation_name_linestring USING gist(geometry); CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_geometry_idx ON osm_transportation_name_linestring USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_highway_partial_idx CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_highway_partial_idx
ON osm_transportation_name_linestring(highway) ON osm_transportation_name_linestring(highway, construction)
WHERE highway IN ('motorway','trunk'); WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_name_linestring -> osm_transportation_name_linestring_gen1 -- etldoc: osm_transportation_name_linestring -> osm_transportation_name_linestring_gen1
CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen1 AS ( CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen1 AS (
SELECT ST_Simplify(geometry, 50) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, network, z_order SELECT ST_Simplify(geometry, 50) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
FROM osm_transportation_name_linestring FROM osm_transportation_name_linestring
WHERE highway IN ('motorway','trunk') AND ST_Length(geometry) > 8000 WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 8000
); );
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_geometry_idx ON osm_transportation_name_linestring_gen1 USING gist(geometry); CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_geometry_idx ON osm_transportation_name_linestring_gen1 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_highway_partial_idx CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen1_highway_partial_idx
ON osm_transportation_name_linestring_gen1(highway) ON osm_transportation_name_linestring_gen1(highway, construction)
WHERE highway IN ('motorway','trunk'); WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_name_linestring_gen1 -> osm_transportation_name_linestring_gen2 -- etldoc: osm_transportation_name_linestring_gen1 -> osm_transportation_name_linestring_gen2
CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen2 AS ( CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen2 AS (
SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, network, z_order SELECT ST_Simplify(geometry, 120) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
FROM osm_transportation_name_linestring_gen1 FROM osm_transportation_name_linestring_gen1
WHERE highway IN ('motorway','trunk') AND ST_Length(geometry) > 14000 WHERE (highway IN ('motorway','trunk') OR highway = 'construction' AND construction IN ('motorway','trunk')) AND ST_Length(geometry) > 14000
); );
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_geometry_idx ON osm_transportation_name_linestring_gen2 USING gist(geometry); CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_geometry_idx ON osm_transportation_name_linestring_gen2 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_highway_partial_idx CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen2_highway_partial_idx
ON osm_transportation_name_linestring_gen2(highway) ON osm_transportation_name_linestring_gen2(highway, construction)
WHERE highway = 'motorway'; WHERE highway IN ('motorway','trunk', 'construction');
-- etldoc: osm_transportation_name_linestring_gen2 -> osm_transportation_name_linestring_gen3 -- etldoc: osm_transportation_name_linestring_gen2 -> osm_transportation_name_linestring_gen3
CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen3 AS ( CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen3 AS (
SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, network, z_order SELECT ST_Simplify(geometry, 200) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
FROM osm_transportation_name_linestring_gen2 FROM osm_transportation_name_linestring_gen2
WHERE highway = 'motorway' AND ST_Length(geometry) > 20000 WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
); );
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_geometry_idx ON osm_transportation_name_linestring_gen3 USING gist(geometry); CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_geometry_idx ON osm_transportation_name_linestring_gen3 USING gist(geometry);
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_highway_partial_idx CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen3_highway_partial_idx
ON osm_transportation_name_linestring_gen3(highway) ON osm_transportation_name_linestring_gen3(highway, construction)
WHERE highway = 'motorway'; WHERE highway IN ('motorway', 'construction');
-- etldoc: osm_transportation_name_linestring_gen3 -> osm_transportation_name_linestring_gen4 -- etldoc: osm_transportation_name_linestring_gen3 -> osm_transportation_name_linestring_gen4
CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen4 AS ( CREATE MATERIALIZED VIEW osm_transportation_name_linestring_gen4 AS (
SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, network, z_order SELECT ST_Simplify(geometry, 500) AS geometry, osm_id, name, name_en, name_de, tags, ref, highway, construction, network, z_order
FROM osm_transportation_name_linestring_gen3 FROM osm_transportation_name_linestring_gen3
WHERE highway = 'motorway' AND ST_Length(geometry) > 20000 WHERE (highway = 'motorway' OR highway = 'construction' AND construction = 'motorway') AND ST_Length(geometry) > 20000
); );
CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen4_geometry_idx ON osm_transportation_name_linestring_gen4 USING gist(geometry); CREATE INDEX IF NOT EXISTS osm_transportation_name_linestring_gen4_geometry_idx ON osm_transportation_name_linestring_gen4 USING gist(geometry);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -27,6 +27,7 @@ tileset:
minzoom: 0 minzoom: 0
pixel_scale: 256 pixel_scale: 256
languages: languages:
- am # Amharic
- ar # Arabic - ar # Arabic
- az # Azerbaijani, Latin - az # Azerbaijani, Latin
- be # Belarusian - be # Belarusian
@ -65,6 +66,7 @@ tileset:
- kn # Kannada - kn # Kannada
- ko # Korean - ko # Korean
- ko_rm # romanization of Korean, Latin - ko_rm # romanization of Korean, Latin
- ku # Kurdish, Latin
- la # Latin, Latin - la # Latin, Latin
- lb # Luxembourgish, Latin - lb # Luxembourgish, Latin
- lt # Lithuanian, Latin - lt # Lithuanian, Latin