diff --git a/Makefile b/Makefile index 0cf6d7b2..8ff02da4 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ all: build/openmaptiles.tm2source/data.yml build/mapping.yaml build/tileset.sql -.PHONY: docs -docs: layers/railway/README.md layers/boundary/README.md layers/water/README.md layers/building/README.md layers/transportation/README.md layers/transportation_name/README.md layers/poi/README.md layers/place/README.md layers/waterway/README.md layers/water_name/README.md layers/landcover/README.md layers/landuse/README.md layers/housenumber/README.md - build/openmaptiles.tm2source/data.yml: mkdir -p build/openmaptiles.tm2source && generate-tm2source openmaptiles.yaml --host="postgres" --port=5432 --database="openmaptiles" --user="openmaptiles" --password="openmaptiles" > build/openmaptiles.tm2source/data.yml @@ -12,44 +9,5 @@ build/mapping.yaml: build/tileset.sql: mkdir -p build && generate-sql openmaptiles.yaml > build/tileset.sql -layers/poi/README.md: - generate-doc layers/poi/poi.yaml --diagram layers/poi/mapping > layers/poi/README.md - -layers/transportation/README.md: - generate-doc layers/transportation/transportation.yaml --diagram layers/transportation/mapping > layers/transportation/README.md - -layers/transportation_name/README.md: - generate-doc layers/transportation_name/transportation_name.yaml > layers/transportation_name/README.md - -layers/railway/README.md: - generate-doc layers/railway/railway.yaml --diagram layers/railway/mapping > layers/railway/README.md - -layers/boundary/README.md: - generate-doc layers/boundary/boundary.yaml --diagram layers/boundary/mapping > layers/boundary/README.md - -layers/water_name/README.md: - generate-doc layers/water_name/water_name.yaml > layers/water_name/README.md - -layers/water/README.md: - generate-doc layers/water/water.yaml --diagram layers/water/mapping > layers/water/README.md - -layers/waterway/README.md: - generate-doc layers/waterway/waterway.yaml --diagram layers/waterway/mapping > layers/waterway/README.md - -layers/building/README.md: - generate-doc layers/building/building.yaml > layers/building/README.md - -layers/place/README.md: - generate-doc layers/place/place.yaml --diagram layers/place/mapping > layers/place/README.md - -layers/landuse/README.md: - generate-doc layers/landuse/landuse.yaml --diagram layers/landuse/mapping > layers/landuse/README.md - -layers/landcover/README.md: - generate-doc layers/landcover/landcover.yaml --diagram layers/landcover/mapping > layers/landcover/README.md - -layers/housenumber/README.md: - generate-doc layers/housenumber/housenumber.yaml > layers/housenumber/README.md - clean: rm -f build/openmaptiles.tm2source/data.yml && rm -f build/mapping.yaml && rm -f build/tileset.sql diff --git a/README.md b/README.md index 6fcdc06b..46c3a963 100644 --- a/README.md +++ b/README.md @@ -17,19 +17,19 @@ We welcome new standard layers from other data sources or import tools (like osm Each layer is documented and self contained. Click on the link for each layer to get more information. Layers can be chosen to create a **Tileset** like the `openmaptiles.yaml` tileset. -- [boundary](layers/boundary/README.md) -- [building](layers/building/README.md) -- [highway](layers/highway/README.md) -- [highway_name](layers/highway_name/README.md) -- [housenumber](layers/housenumber/README.md) -- [landcover](layers/landcover/README.md) -- [landuse](layers/landuse/README.md) -- [place](layers/place/README.md) -- [poi](layers/poi/README.md) -- [railway](layers/railway/README.md) -- [water](layers/water/README.md) -- [water_name](layers/water_name/README.md) -- [waterway](layers/waterway/README.md) +- [boundary](https://github.com/openmaptiles/openmaptiles/wiki/boundary) +- [building](https://github.com/openmaptiles/openmaptiles/wiki/building) +- [highway](https://github.com/openmaptiles/openmaptiles/wiki/highway) +- [highway_name](https://github.com/openmaptiles/openmaptiles/wiki/highway_name) +- [housenumber](https://github.com/openmaptiles/openmaptiles/wiki/housenumber) +- [landcover](https://github.com/openmaptiles/openmaptiles/wiki/landcover) +- [landuse](https://github.com/openmaptiles/openmaptiles/wiki/landuse) +- [place](https://github.com/openmaptiles/openmaptiles/wiki/place) +- [poi](https://github.com/openmaptiles/openmaptiles/wiki/poi) +- [railway](https://github.com/openmaptiles/openmaptiles/wiki/railway) +- [water](https://github.com/openmaptiles/openmaptiles/wiki/water) +- [water_name](https://github.com/openmaptiles/openmaptiles/wiki/water_name) +- [waterway](https://github.com/openmaptiles/openmaptiles/wiki/waterway) ### Define your own Layer diff --git a/docker-compose.yml b/docker-compose.yml index b67e4839..b9e79c77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,12 +5,12 @@ services: postgres: image: "openmaptiles/postgis:2.2" volumes: - - pgdata:/var/lib/postgresql/data + - pgdata:/var/lib/postgresql/data ports: - "5432" env_file: .env import-natural-earth: - image: "openmaptiles/import-natural-earth" + image: "openmaptiles/import-natural-earth:1.0" env_file: .env links: - postgres @@ -20,7 +20,7 @@ services: links: - postgres import-lakelines: - image: "openmaptiles/import-lakelines" + image: "openmaptiles/import-lakelines:0.9" env_file: .env links: - postgres diff --git a/layers/boundary/README.md b/layers/boundary/README.md deleted file mode 100644 index 98e68275..00000000 --- a/layers/boundary/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# boundary - -Contains administrative boundaries as linestrings (no maritime boundaries yet) as linestrings. -Until z7 [Natural Earth data](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-countries/) -is used after which OSM boundaries ([`boundary=administrative`](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative)) are present from z8 to z14. -OSM data contains all [`admin_level`](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#admin_level) -but for most styles it makes sense to just style `admin_level=2` and `admin_level=4`. - -## Fields - -- **admin_level**: OSM [admin_level](http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative#admin_level) -indicating the level of importance of this boundary. -At low zoom levels the Natural Earth boundaries are mapped to the equivalent admin levels. - -## Mapping - -![](mapping.png) - - diff --git a/layers/boundary/boundary.sql b/layers/boundary/boundary.sql index f7cd745d..5045e15f 100644 --- a/layers/boundary/boundary.sql +++ b/layers/boundary/boundary.sql @@ -56,6 +56,18 @@ CREATE OR REPLACE VIEW boundary_z5 AS ( WHERE scalerank <= 7 AND featurecla = 'Adm-1 boundary' ); +-- etldoc: ne_10m_admin_0_boundary_lines_land -> boundary_z6 +-- etldoc: ne_10m_admin_1_states_provinces_lines_shp -> boundary_z6 + +CREATE OR REPLACE VIEW boundary_z6 AS ( + SELECT geom, 2 AS admin_level + FROM ne_10m_admin_0_boundary_lines_land + UNION ALL + SELECT geom, 4 AS admin_level + FROM ne_10m_admin_1_states_provinces_lines_shp + WHERE scalerank <= 9 AND featurecla = 'Adm-1 boundary' +); + -- etldoc: ne_10m_admin_0_boundary_lines_land -> boundary_z7 -- etldoc: ne_10m_admin_1_states_provinces_lines_shp -> boundary_z7 CREATE OR REPLACE VIEW boundary_z7 AS ( @@ -102,8 +114,8 @@ CREATE OR REPLACE VIEW boundary_z12 AS ( FROM osm_boundary_linestring_gen1 ); --- etldoc: layer_boundary[shape=record fillcolor=lightpink, style="rounded,filled", --- etldoc: label=" layer_boundary | z0 | z1_2 | z3 | z4 | z5_6 | z7 | z8 | z9 | z10 | z11 | z12| z13_ " ] +-- etldoc: layer_boundary[shape=record fillcolor=lightpink, style="rounded,filled", +-- etldoc: label=" layer_boundary | z0 | z1_2 | z3 | z4 | z5 || z6 || z7 | z8 | z9 | z10 | z11 | z12| z13+"] CREATE OR REPLACE FUNCTION layer_boundary (bbox geometry, zoom_level int) RETURNS TABLE(geometry geometry, admin_level int) AS $$ @@ -120,8 +132,11 @@ RETURNS TABLE(geometry geometry, admin_level int) AS $$ -- etldoc: boundary_z4 -> layer_boundary:z4 SELECT * FROM boundary_z4 WHERE geom && bbox AND zoom_level = 4 UNION ALL - -- etldoc: boundary_z5 -> layer_boundary:z5_6 - SELECT * FROM boundary_z5 WHERE geom && bbox AND zoom_level BETWEEN 5 AND 6 + -- etldoc: boundary_z5 -> layer_boundary:z5 + SELECT * FROM boundary_z5 WHERE geom && bbox AND zoom_level = 5 + UNION ALL + -- etldoc: boundary_z6 -> layer_boundary:z6 + SELECT * FROM boundary_z6 WHERE geom && bbox AND zoom_level = 6 UNION ALL -- etldoc: boundary_z7 -> layer_boundary:z7 SELECT * FROM boundary_z7 WHERE geom && bbox AND zoom_level = 7 @@ -141,7 +156,7 @@ RETURNS TABLE(geometry geometry, admin_level int) AS $$ -- etldoc: boundary_z12 -> layer_boundary:z12 SELECT * FROM boundary_z12 WHERE geom && bbox AND zoom_level = 12 UNION ALL - -- etldoc: boundary_z12 -> layer_boundary:z13_ + -- etldoc: boundary_z12 -> layer_boundary:z13 SELECT * FROM boundary_z12 WHERE geom && bbox AND zoom_level >= 13 ) AS zoom_levels; $$ LANGUAGE SQL IMMUTABLE; diff --git a/layers/boundary/mapping.png b/layers/boundary/mapping.png deleted file mode 100644 index 72032cdf..00000000 Binary files a/layers/boundary/mapping.png and /dev/null differ diff --git a/layers/boundary/mapping.yaml b/layers/boundary/mapping.yaml index 6223c54f..5eee06e4 100644 --- a/layers/boundary/mapping.yaml +++ b/layers/boundary/mapping.yaml @@ -3,27 +3,27 @@ generalized_tables: # etldoc: imposm3 -> osm_boundary_linestring_gen5 boundary_linestring_gen5: source: boundary_linestring - tolerance: 420.0 + tolerance: 480.0 # etldoc: imposm3 -> osm_boundary_linestring_gen4 boundary_linestring_gen4: source: boundary_linestring - tolerance: 320.0 + tolerance: 240.0 # etldoc: imposm3 -> osm_boundary_linestring_gen3 boundary_linestring_gen3: source: boundary_linestring - tolerance: 150.0 + tolerance: 120.0 # etldoc: imposm3 -> osm_boundary_linestring_gen2 boundary_linestring_gen2: source: boundary_linestring - tolerance: 100.0 + tolerance: 60.0 # etldoc: imposm3 -> osm_boundary_linestring_gen1 boundary_linestring_gen1: source: boundary_linestring - tolerance: 50.0 + tolerance: 30.0 tables: # etldoc: imposm3 -> osm_boundary_linestring diff --git a/layers/building/README.md b/layers/building/README.md deleted file mode 100644 index 9762193e..00000000 --- a/layers/building/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# building - -All [OSM Buildings](http://wiki.openstreetmap.org/wiki/Buildings). All building tags are imported ([`building=*`](http://wiki.openstreetmap.org/wiki/Key:building)). The buildings are not yet ready for 3D rendering support and any help to improve -this is welcomed. - -## Fields - -- **render_height**: An approximated height from levels and height of building after the method of Paul Norman in [OSM Clear](https://github.com/ClearTables/osm-clear). For future 3D rendering of buildings. - - - diff --git a/layers/building/building.sql b/layers/building/building.sql index 9de11ac2..1db198af 100644 --- a/layers/building/building.sql +++ b/layers/building/building.sql @@ -1,21 +1,23 @@ - - - --- etldoc: layer_building[shape=record fillcolor=lightpink, style="rounded,filled", +-- etldoc: layer_building[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label="layer_building | z13 | z14_ " ] ; CREATE OR REPLACE FUNCTION layer_building(bbox geometry, zoom_level int) -RETURNS TABLE(geom geometry, osm_id bigint, render_height numeric) AS $$ - SELECT geometry, osm_id, - least(greatest(3, COALESCE(height, levels*3.66,5)),400)^.7::int AS render_height +RETURNS TABLE(geom geometry, osm_id bigint, render_height int, render_min_height int) AS $$ + SELECT geometry, osm_id, render_height, render_min_height FROM ( - -- etldoc: osm_building_polygon_gen1 -> layer_building:z13 - SELECT osm_id, geometry, height, levels FROM osm_building_polygon_gen1 + SELECT + osm_id, geometry, + NULL::int AS render_height, NULL::int AS render_min_height + FROM osm_building_polygon_gen1 WHERE zoom_level = 13 AND geometry && bbox AND area > 1400 UNION ALL -- etldoc: osm_building_polygon -> layer_building:z14_ - SELECT osm_id, geometry, height, levels FROM osm_building_polygon + SELECT + osm_id, geometry, + greatest(5, COALESCE(height, levels*3.66,5))::int AS render_height, + greatest(0, COALESCE(min_height, min_level*3.66,0))::int AS render_min_height + FROM osm_building_polygon WHERE zoom_level >= 14 AND geometry && bbox ) AS zoom_levels ORDER BY render_height ASC, ST_YMin(geometry) DESC; diff --git a/layers/building/building.yaml b/layers/building/building.yaml index 2830e23c..1238a333 100644 --- a/layers/building/building.yaml +++ b/layers/building/building.yaml @@ -5,10 +5,12 @@ layer: this is welcomed. buffer_size: 4 datasource: - query: (SELECT geom FROM layer_building(!bbox!, z(!scale_denominator!))) AS t + query: (SELECT geom, render_height, render_min_height FROM layer_building(!bbox!, z(!scale_denominator!))) AS t fields: render_height: | - An approximated height from levels and height of building after the method of Paul Norman in [OSM Clear](https://github.com/ClearTables/osm-clear). For future 3D rendering of buildings. + An approximated height from levels and height of the building or building:part after the method of Paul Norman in [OSM Clear](https://github.com/ClearTables/osm-clear). For future 3D rendering of buildings. + render_min_height: | + An approximated height from levels and height of the bottom of the building or building:part after the method of Paul Norman in [OSM Clear](https://github.com/ClearTables/osm-clear). For future 3D rendering of buildings. schema: - ./building.sql datasources: diff --git a/layers/building/mapping.yaml b/layers/building/mapping.yaml index 8974234b..92703599 100644 --- a/layers/building/mapping.yaml +++ b/layers/building/mapping.yaml @@ -17,13 +17,29 @@ tables: type: validated_geometry - name: area type: pseudoarea + - name: building + key: building + type: string - name: height key: height type: integer + - name: min_height + key: min_height + type: integer - name: levels - key: levels + key: building:levels + type: integer + - name: min_level + key: building:min_level type: integer mapping: + building:part: + - __any__ building: - __any__ + filters: + exclude_tags: + - [ "building", "no" ] + - [ "building", "none" ] + - [ "building", "No" ] type: polygon diff --git a/layers/housenumber/README.md b/layers/housenumber/README.md deleted file mode 100644 index 637bd3a1..00000000 --- a/layers/housenumber/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# housenumber - -Everything in OpenStreetMap which contains a `addr:housenumber` tag useful for labelling housenumbers on a map. -This adds significant size to *z14*. For buildings the centroid of the building is used as housenumber. - -## Fields - -- **housenumber**: Value of the [`addr:housenumber`](http://wiki.openstreetmap.org/wiki/Key:addr) tag. - - - diff --git a/layers/landcover/README.md b/layers/landcover/README.md deleted file mode 100644 index a6e78f2a..00000000 --- a/layers/landcover/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# landcover - -Landcover is used to describe the physical material at the surface of the earth. At lower zoom levels this is -from Natural Earth data for glaciers and ice shelves and at higher zoom levels the landcover is implied -by OSM tags (like `landuse` or `natural`). - -## Fields - -- **class**: More generalized groups of either `farmland`, `ice`, `wood`, `grass` or `wetland`. -Use this to assign general colors to the landcover. -- **subclass**: Original value of either the `landuse`, `natural` or `wetland` tag. -Use this to do more precise styling. - -## Mapping - -![](mapping.png) - - diff --git a/layers/landcover/mapping.png b/layers/landcover/mapping.png deleted file mode 100644 index 1662cf5c..00000000 Binary files a/layers/landcover/mapping.png and /dev/null differ diff --git a/layers/landuse/README.md b/layers/landuse/README.md deleted file mode 100644 index 9b024bed..00000000 --- a/layers/landuse/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# landuse - -Landuse is used to describe use of land by humans.At lower zoom levels this is -from Natural Earth data for residential (urban) areas and at higher zoom levels mostly OSM `landuse` tags. - -## Fields - -- **class**: More generalized groups of either `park`, `school`, `hospital`, `railway`, -`cemetery`, `military`, `residential`. Use this to assign general for landuse. -- **subclass**: Original value of either the `amenity`, `landuse`, `leisure` or `boundary` tag. -Use this to do more precise styling. - -## Mapping - -![](mapping.png) - - diff --git a/layers/landuse/mapping.png b/layers/landuse/mapping.png deleted file mode 100644 index 0a4647cd..00000000 Binary files a/layers/landuse/mapping.png and /dev/null differ diff --git a/layers/place/README.md b/layers/place/README.md deleted file mode 100644 index bd928b47..00000000 --- a/layers/place/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# place - -The place layer consists out of [countries](http://wiki.openstreetmap.org/wiki/Tag:place%3Dcountry), -[states](http://wiki.openstreetmap.org/wiki/Tag:place%3Dstate) and [cities](http://wiki.openstreetmap.org/wiki/Key:place). -Apart from the roads this is also one of the more important layers to create a beautiful map. -We suggest you use different font styles and sizes to create a text hierarchy. - -## Fields - -- **name_en**: The english `name:en` value if available. -- **name**: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI. -- **rank**: Countries, states and the most important cities all have a `rank` to boost their importance on the map. -The `rank` field for counries and states ranges from `1` to `6` while the `rank` field for -cities ranges from `1` to `10` for the most important cities and continues from `10` serially based -on the local importance of the city (derived from population and city class). -Use the `rank` field to build a text hierarchy. -The rank value is a combination of the Natural Earth `scalerank`, `labelrank` and `datarank` values for countries -and states and for cities consists out of a shifted Natural Earth `scalerank` combined with a local rank -within a grid for cities that do not have a Natural Earth `scalerank`. -- **class**: Distinguish between `country`, `state` and other city classes like -`city`, `town`, `village`, `hamlet`, `suburb`, `neighbourhood` or `isolated_dwelling`. -Use this to separately style the different places according to their importance (usually country and state different -than cities). - -## Mapping - -![](mapping.png) - - diff --git a/layers/place/city.sql b/layers/place/city.sql index af23866e..ab96fe44 100644 --- a/layers/place/city.sql +++ b/layers/place/city.sql @@ -9,7 +9,7 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class c FROM osm_city_point WHERE geometry && bbox AND ((zoom_level = 2 AND "rank" = 1) - OR (zoom_level BETWEEN 3 AND 7 AND "rank" <= zoom_level) + OR (zoom_level BETWEEN 3 AND 7 AND "rank" <= zoom_level + 1) ) UNION ALL SELECT osm_id, geometry, name, diff --git a/layers/place/mapping.png b/layers/place/mapping.png deleted file mode 100644 index ed7581c6..00000000 Binary files a/layers/place/mapping.png and /dev/null differ diff --git a/layers/poi/README.md b/layers/poi/README.md deleted file mode 100644 index de80bafc..00000000 --- a/layers/poi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# poi - -[Points of interests](http://wiki.openstreetmap.org/wiki/Points_of_interest) containing -a of a variety of OpenStreetMap tags. Mostly contains amenities, sport, shop and tourist POIs. - -## Fields - -- **class**: More general classes of POIs. If there is no more general `class` for the `subclass` -this field will contain the same value as `subclass`. -But for example for schools you only need to style the class `school` to filter the subclasses `school` -and `kindergarten`. Or use the class `shop` to style all shops. -- **name_en**: The english `name:en` value if available. -- **name**: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI. -- **rank**: The POIs are ranked ascending according to their importance within a grid. The `rank` value shows the -local relative importance of a POI within it's cell in the grid. This can be used to reduce label density at z14. -Since all POIs already need to be contained at `z14` you can use `less than rank=10` epxression to limit -POIs. At some point like z17 you can show all POIs. -- **subclass**: Original value of either the -[`amenity`](http://wiki.openstreetmap.org/wiki/Key:amenity), -[`leisure`](http://wiki.openstreetmap.org/wiki/Key:leisure), -[`landuse`](http://wiki.openstreetmap.org/wiki/Key:landuse), -[`sport`](http://wiki.openstreetmap.org/wiki/Key:sport), -[`tourism`](http://wiki.openstreetmap.org/wiki/Key:tourism) -or [`shop`](http://wiki.openstreetmap.org/wiki/Key:shop) -tag. Use this to do more precise styling. - -## Mapping - -![](mapping.png) - - diff --git a/layers/poi/layer.sql b/layers/poi/layer.sql index b82dc419..68dcec13 100644 --- a/layers/poi/layer.sql +++ b/layers/poi/layer.sql @@ -1,18 +1,25 @@ --- etldoc: layer_poi[shape=record fillcolor=lightpink, style="rounded,filled", +-- etldoc: layer_poi[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label="layer_poi | z14_" ] ; CREATE OR REPLACE FUNCTION layer_poi(bbox geometry, zoom_level integer, pixel_width numeric) RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class text, subclass text, "rank" int) AS $$ - SELECT osm_id, geometry, name, NULLIF(name_en, ''), poi_class(subclass) AS class, subclass, + SELECT osm_id, geometry, NULLIF(name, '') AS name, NULLIF(name_en, '') AS name_en, poi_class(subclass) AS class, subclass, row_number() OVER ( PARTITION BY LabelGrid(geometry, 100 * pixel_width) - ORDER BY poi_class_rank(poi_class(subclass)) ASC, length(name) DESC + ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass)) END ASC )::int AS "rank" - -- etldoc: osm_poi_point -> layer_poi:z14_ - FROM osm_poi_point - WHERE geometry && bbox - AND zoom_level >= 14 - AND name <> '' - ORDER BY "rank"; + FROM ( + -- etldoc: osm_poi_point -> layer_poi:z14 + SELECT * FROM osm_poi_point + WHERE geometry && bbox + AND zoom_level >= 14 + UNION ALL + -- etldoc: osm_poi_polygon -> layer_poi:z14 + SELECT * FROM osm_poi_polygon + WHERE geometry && bbox + AND zoom_level >= 14 + ) as poi_union + ORDER BY "rank" + ; $$ LANGUAGE SQL IMMUTABLE; diff --git a/layers/poi/mapping.png b/layers/poi/mapping.png deleted file mode 100644 index 7b853817..00000000 Binary files a/layers/poi/mapping.png and /dev/null differ diff --git a/layers/poi/mapping.yaml b/layers/poi/mapping.yaml index 37c71938..75053131 100644 --- a/layers/poi/mapping.yaml +++ b/layers/poi/mapping.yaml @@ -1,3 +1,296 @@ + +# imposm3 mapping file for https://github.com/osm2vectortiles/imposm3 +# Warning: this is not the official imposm3 + +# aerialway values , see http://taginfo.openstreetmap.org/keys/aerialway#values +def_poi_mapping_aerialway: &poi_mapping_aerialway + - station + +# amenity values , see http://taginfo.openstreetmap.org/keys/amenity#values +def_poi_mapping_amenity: &poi_mapping_amenity + - arts_centre + - bank + - bar + - bbq + - bicycle_rental + - biergarten + - bus_station + - cafe + - cinema + - college + - community_centre + - courthouse + - dentist + - doctors + - embassy + - fast_food + - ferry_terminal + - fire_station + - food_court + - fuel + - grave_yard + - hospital + - ice_cream + - kindergarten + - library + - marketplace + - nightclub + - nursing_home + - pharmacy + - place_of_worship + - police + - post_box + - post_office + - prison + - pub + - public_building + - recycling + - restaurant + - school + - shelter + - swimming_pool + - taxi + - telephone + - theatre + - toilets + - townhall + - university + - veterinary + - waste_basket + +# barrier values , see http://taginfo.openstreetmap.org/keys/barrier#values +def_poi_mapping_barrier: &poi_mapping_barrier + - bollard + - border_control + - cycle_barrier + - gate + - lift_gate + - sally_port + - stile + - toll_booth + +# highway values , see http://taginfo.openstreetmap.org/keys/highway#values +def_poi_mapping_highway: &poi_mapping_highway + - bus_stop + +# historic values , see http://taginfo.openstreetmap.org/keys/historic#values +def_poi_mapping_historic: &poi_mapping_historic + - monument + +# landuse values , see http://taginfo.openstreetmap.org/keys/landuse#values +def_poi_mapping_landuse: &poi_mapping_landuse + - basin + - brownfield + - cemetery + - reservoir + +# leisure values , see http://taginfo.openstreetmap.org/keys/leisure#values +def_poi_mapping_leisure: &poi_mapping_leisure + - dog_park + - garden + - golf_course + - ice_rink + - marina + - miniature_golf + - park + - pitch + - playground + - sports_centre + - stadium + - swimming_area + - swimming_pool + - water_park + +# shop values , see http://taginfo.openstreetmap.org/keys/shop#values +def_poi_mapping_shop: &poi_mapping_shop + - accessories + - alcohol + - antiques + - art + - bag + - bakery + - beauty + - bed + - beverages + - bicycle + - books + - boutique + - butcher + - camera + - car + - car_repair + - carpet + - charity + - chemist + - chocolate + - clothes + - coffee + - computer + - confectionery + - convenience + - copyshop + - cosmetics + - deli + - delicatessen + - department_store + - doityourself + - dry_cleaning + - electronics + - erotic + - fabric + - florist + - furniture + - garden_centre + - general + - gift + - greengrocer + - hairdresser + - hardware + - hearing_aids + - hifi + - ice_cream + - interior_decoration + - jewelry + - kiosk + - lamps + - laundry + - mall + - massage + - mobile_phone + - motorcycle + - music + - musical_instrument + - newsagent + - optician + - outdoor + - perfume + - perfumery + - pet + - photo + - second_hand + - shoes + - sports + - stationery + - supermarket + - tailor + - tattoo + - ticket + - tobacco + - toys + - travel_agency + - video + - video_games + - watches + - weapons + - wholesale + - wine + +# sport values , see http://taginfo.openstreetmap.org/keys/sport#values +def_poi_mapping_sport: &poi_mapping_sport + - american_football + - archery + - athletics + - australian_football + - badminton + - baseball + - basketball + - beachvolleyball + - billiards + - bmx + - boules + - bowls + - boxing + - canadian_football + - canoe + - chess + - climbing + - climbing_adventure + - cricket + - cricket_nets + - croquet + - curling + - cycling + - disc_golf + - diving + - dog_racing + - equestrian + - fatsal + - field_hockey + - free_flying + - gaelic_games + - golf + - gymnastics + - handball + - hockey + - horse_racing + - horseshoes + - ice_hockey + - ice_stock + - judo + - karting + - korfball + - long_jump + - model_aerodrome + - motocross + - motor + - multi + - netball + - orienteering + - paddle_tennis + - paintball + - paragliding + - pelota + - racquet + - rc_car + - rowing + - rugby + - rugby_league + - rugby_union + - running + - sailing + - scuba_diving + - shooting + - shooting_range + - skateboard + - skating + - skiing + - soccer + - surfing + - swimming + - table_soccer + - table_tennis + - team_handball + - tennis + - toboggan + - volleyball + - water_ski + - yoga + +# tourism values , see http://taginfo.openstreetmap.org/keys/tourism#values +def_poi_mapping_tourism: &poi_mapping_tourism + - alpine_hut + - artwork + - attraction + - bed_and_breakfast + - camp_site + - caravan_site + - chalet + - gallery + - guest_house + - hostel + - hotel + - information + - motel + - museum + - picnic_site + - theme_park + - viewpoint + - zoo + +# waterway values , see http://taginfo.openstreetmap.org/keys/waterway#values +def_poi_mapping_waterway: &poi_mapping_waterway + - dock + tables: # etldoc: imposm3 -> osm_poi_point poi_point: @@ -16,269 +309,44 @@ tables: - name: subclass type: mapping_value mapping: - amenity: - - arts_centre - - police - - fire_station - - post_box - - post_office - - telephone - - library - - townhall - - courthouse - - prison - - place_of_worship - - embassy - - community_centre - - nursing_home - - university - - school - - kindergarten - - college - - public_building - - pharmacy - - hospital - - doctors - - dentist - - veterinary - - theatre - - nightclub - - cinema - - restaurant - - recycling - - fast_food - - cafe - - pub - - bar - - food_court - - biergarten - - swimming_pool - - shelter - - grave_yard - - bank - - ferry_terminal - - fuel - - waste_basket - - bicycle_rental - - bbq - - taxi - - bus_station - - marketplace - - toilets - leisure: - - park - - playground - - dog_park - - sports_centre - - pitch - - swimming_pool - - swimming_area - - water_park - - golf_course - - miniature_golf - - marina - - stadium - - ice_rink - - garden - landuse: - - cemetery - - basin - - reservoir - - brownfield - sport: - - swimming - - tennis - - soccer - - baseball - - basketball - - multi - - golf - - equestrian - - athletics - - volleyball - - climbing - - bowls - - american_football - - skateboard - - shooting - - skiing - - boules - - beachvolleyball - - cricket - - table_tennis - - hockey - - gymnastics - - running - - canoe - - rugby_union - - skating - - scuba_diving - - motor - - horse_racing - - handball - - team_handball - - karting - - cycling - - archery - - motocross - - pelota - - rugby - - gaelic_games - - model_aerodrome - - netball - - rugby_league - - free_flying - - rowing - - chess - - australian_football - - cricket_nets - - racquet - - bmx - - sailing - - ice_stock - - badminton - - paddle_tennis - - dog_racing - - fatsal - - billiards - - ice_hockey - - yoga - - disc_golf - - orienteering - - toboggan - - horseshoes - - paragliding - - korfball - - diving - - rc_car - - canadian_football - - field_hockey - - shooting_range - - boxing - - curling - - surfing - - water_ski - - judo - - croquet - - paintball - - climbing_adventure - - long_jump - - table_soccer - tourism: - - attraction - - artwork - - gallery - - hotel - - motel - - bed_and_breakfast - - guest_house - - hostel - - chalet - - camp_site - - alpine_hut - - caravan_site - - museum - - viewpoint - - zoo - - theme_park - - information - - picnic_site - shop: - - accessories - - alcohol - - antiques - - art - - bag - - bakery - - beauty - - bed - - beverages - - bicycle - - books - - boutique - - butcher - - camera - - car - - car_repair - - carpet - - charity - - chemist - - chocolate - - clothes - - coffee - - computer - - confectionery - - convenience - - copyshop - - cosmetics - - garden_centre - - deli - - delicatessen - - department_store - - doityourself - - dry_cleaning - - video - - electronics - - erotic - - fabric - - florist - - furniture - - video_games - - general - - gift - - greengrocer - - hairdresser - - hardware - - hearing_aids - - hifi - - ice_cream - - interior_decoration - - jewelry - - kiosk - - lamps - - laundry - - mall - - massage - - mobile_phone - - motorcycle - - music - - musical_instrument - - newsagent - - optician - - outdoor - - perfumery - - perfume - - pet - - photo - - second_hand - - shoes - - sports - - stationery - - supermarket - - tailor - - tattoo - - ticket - - tobacco - - toys - - travel_agency - - watches - - weapons - - wholesale - - wine - highway: - - bus_stop - barrier: - - sally_port - - lift_gate - - gate - - bollard - - stile - - cycle_barrier - - toll_booth - - border_control - historic: - - monument - waterway: - - dock - aerialway: - - station + aerialway: *poi_mapping_aerialway + amenity: *poi_mapping_amenity + barrier: *poi_mapping_barrier + highway: *poi_mapping_highway + historic: *poi_mapping_historic + landuse: *poi_mapping_landuse + leisure: *poi_mapping_leisure + shop: *poi_mapping_shop + sport: *poi_mapping_sport + tourism: *poi_mapping_tourism + waterway: *poi_mapping_waterway + + + # etldoc: imposm3 -> osm_poi_polygon + poi_polygon: + type: polygon + fields: + - name: osm_id + type: id + - name: geometry + type: geometry + - name: name + key: name + type: string + - name: name_en + key: name:en + type: string + - name: subclass + type: mapping_value + mapping: + aerialway: *poi_mapping_aerialway + amenity: *poi_mapping_amenity + barrier: *poi_mapping_barrier + highway: *poi_mapping_highway + historic: *poi_mapping_historic + landuse: *poi_mapping_landuse + leisure: *poi_mapping_leisure + shop: *poi_mapping_shop + sport: *poi_mapping_sport + tourism: *poi_mapping_tourism + waterway: *poi_mapping_waterway \ No newline at end of file diff --git a/layers/poi/poi.yaml b/layers/poi/poi.yaml index cc1716b1..9526228c 100644 --- a/layers/poi/poi.yaml +++ b/layers/poi/poi.yaml @@ -32,6 +32,7 @@ layer: srid: 900913 query: (SELECT geometry, name, name_en, class, subclass, rank FROM layer_poi(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t schema: + - ./poi_polygon_update.sql - ./class.sql - ./layer.sql datasources: diff --git a/layers/poi/poi_polygon_update.sql b/layers/poi/poi_polygon_update.sql new file mode 100644 index 00000000..1e5073d7 --- /dev/null +++ b/layers/poi/poi_polygon_update.sql @@ -0,0 +1,5 @@ +-- etldoc: osm_poi_polygon -> osm_poi_polygon +UPDATE osm_poi_polygon SET geometry=topoint(geometry) +WHERE ST_GeometryType(geometry) <> 'ST_Point'; + +ANALYZE osm_poi_polygon; diff --git a/layers/transportation/README.md b/layers/transportation/README.md deleted file mode 100644 index ee88c254..00000000 --- a/layers/transportation/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# highway - -Roads or [`highway`](http://wiki.openstreetmap.org/wiki/Key:highway) in OpenStreetMap lingo. -This layer is directly derived from the OSM road hierarchy which is why it is called `highway`. Only -at zoom level 4 to 7 some major highways from Natural Earth are used otherwise it is only OSM data. -It contains all roads from motorways to primary, secondary and tertiary roads to residential roads and -foot paths. Styling the roads is the most essential part of the map. If you can put enough effort into it -makes sense to carefully style each `subclass`. For more comfortable styling you can also just style the roads -by `class`. Roads can have different properties, a road can have `oneway=yes` and `bridge=yes` at the same time. -These properties are reflected in the field `properties`. -This layer is not meant for labelling the roads (the purpose of the layer `highway_name`). - -The `highway` layer also contains polygons for things like plazas. - -## Fields - -- **class**: Either `motorway`, `major_road` (containing `trunk`, `primary`, `secondary` and `tertiary` roads) and `minor_road` (less important roads in the hierarchy like `residential` or `service`) or `path` for -non vehicle paths (such as `cycleway` or `footpath`). -- **subclass**: Original value of the [`highway`](http://wiki.openstreetmap.org/wiki/Key:highway) tag. Use this to do more -precise styling. -- **properties**: Additional properties describing the nature of road. -The properties `bridge` and `tunnel` can be combined with `oneway` as well. So to style all bridges the same you -should style both the properties `bridge` and `bridge:oneway`. -Properties can be one of `bridge:oneway`, `tunnel:oneway`, `ramp`, `ford`, `bridge`, `tunnel` or`oneway`. - -## Mapping - -![](mapping.png) - - diff --git a/layers/transportation/mapping b/layers/transportation/mapping deleted file mode 100644 index b5a74703..00000000 --- a/layers/transportation/mapping +++ /dev/null @@ -1,39 +0,0 @@ -digraph "Imposm Mapping" { - graph [rankdir=LR ranksep=3] - subgraph highway_polygon { - node [fixed_size=shape "width:"=20] - highway_polygon [shape=box] - key_highway [label=highway shape=box] - key_highway -> highway_polygon [label=pedestrian] - } - subgraph highway_linestring { - node [fixed_size=shape "width:"=20] - highway_linestring [shape=box] - key_highway [label=highway shape=box] - key_highway -> highway_linestring [label="motorway -motorway_link -trunk -trunk_link -primary -primary_link -secondary -secondary_link -tertiary -tertiary_link -unclassified -residential -road -living_street -raceway -construction -track -service -path -cycleway -bridleway -footway -corridor -crossing -pedestrian"] - } -} \ No newline at end of file diff --git a/layers/transportation/mapping.png b/layers/transportation/mapping.png deleted file mode 100644 index 363342bc..00000000 Binary files a/layers/transportation/mapping.png and /dev/null differ diff --git a/layers/transportation_name/README.md b/layers/transportation_name/README.md deleted file mode 100644 index e0c998c6..00000000 --- a/layers/transportation_name/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# highway_name - -This is the layer for labelling the highways. Only highways that are named `name=*` and are long enough -to place text upon appear. The OSM roads are stitched together if they contain the same name -to have better label placement than having many small linestrings. -For motorways you should use the `ref` field to label them while for other roads you should use `name`. - -## Fields - -- **ref**: The OSM [`ref`](http://wiki.openstreetmap.org/wiki/Key:ref) tag of the motorway or road. -- **ref_length**: Length of the `ref` field. Useful for having a shield icon as background for labeling motorways. -- **name**: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Highways#Names_and_references) value of the highway. -- **subclass**: Original value of the [`highway`](http://wiki.openstreetmap.org/wiki/Key:highway) tag. Use this to do more -precise styling. -- **class**: Either `motorway`, `major_road` (containing `trunk`, `primary`, `secondary` and `tertiary` roads) and `minor_road` (less important roads in the hierarchy like `residential` or `service`) or `path` for -non vehicle paths (such as `cycleway` or `footpath`). - - - diff --git a/layers/water/README.md b/layers/water/README.md deleted file mode 100644 index 1152e628..00000000 --- a/layers/water/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# water - -Water polygons representing oceans and lakes. Covered watered areas are excluded (`covered=yes`). -Until z6 all water originates from Natural Earth. To get a more correct display of the south pole you should also -style the covering ice shelves over the water. -Water from OpenStreetMap after z7 is split into many smaller polygons to improve rendering performance. -This however can lead to less rendering options in clients since these boundaries show up. So you might not be -able to use border styling for ocean water features. - -## Fields - -- **class**: Either `ocean`, `lake` or `river`. - -## Mapping - -![](mapping.png) - - diff --git a/layers/water/mapping.png b/layers/water/mapping.png deleted file mode 100644 index f0f09e34..00000000 Binary files a/layers/water/mapping.png and /dev/null differ diff --git a/layers/water_name/README.md b/layers/water_name/README.md deleted file mode 100644 index a87f4eb9..00000000 --- a/layers/water_name/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# water_name - -Lake center lines for labelling lake bodies. -This is based of the [osm-lakelines](https://github.com/lukasmartinelli/osm-lakelines) project -which derives nice centerlines from OSM water bodies. Only the most important lakes contain labels. - -## Fields - -- **name_en**: The english `name:en` value if available. -- **name**: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the water body. -- **class**: At the moment only `lake` since no ocean parts are labelled. *Reserved for future use*. - - - diff --git a/layers/waterway/README.md b/layers/waterway/README.md deleted file mode 100644 index 48983945..00000000 --- a/layers/waterway/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# waterway - -Rivers based of OpenStreetMap [waterways](http://wiki.openstreetmap.org/wiki/Waterways) for *z8* to *z14* -and Natural Earth rivers and lake centerlines from *z3* to *z7*. -Too short linestrings are filtered out for some zoom levels. Waterways do no not have a `subclass`. - -## Fields - -- **class**: The original value of the [`waterway`](http://wiki.openstreetmap.org/wiki/Key:waterway) tag. -Can be one of [`stream`](http://wiki.openstreetmap.org/wiki/Tag:waterway%3Dstream), -[`river`](http://wiki.openstreetmap.org/wiki/Tag:waterway%3Driver), -[`canal`](http://wiki.openstreetmap.org/wiki/Tag:waterway%3Dcanal), -[`drain`](http://wiki.openstreetmap.org/wiki/Tag:waterway%3Ddrain), -[`ditch`](http://wiki.openstreetmap.org/wiki/Tag:waterway%3Dditch)`. - -## Mapping - -![](mapping.png) - - diff --git a/layers/waterway/mapping.png b/layers/waterway/mapping.png deleted file mode 100644 index 51a4f6e7..00000000 Binary files a/layers/waterway/mapping.png and /dev/null differ