diff --git a/Makefile b/Makefile index aa4765c..dd0634b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ 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/highway/README.md layers/highway_name/README.md layers/poi/README.md - +docs: layers/railway/README.md layers/boundary/README.md layers/water/README.md layers/building/README.md layers/highway/README.md layers/highway_name/README.md layers/poi/README.md layers/place/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 @@ -34,5 +33,8 @@ layers/water/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 + clean: rm -f build/openmaptiles.tm2source/data.yml && rm -f build/mapping.yaml && rm -f build/tileset.sql && rm -f layers/**/README.md&& rm -f layers/**/*.png diff --git a/layers/place/README.md b/layers/place/README.md new file mode 100644 index 0000000..0e997ab --- /dev/null +++ b/layers/place/README.md @@ -0,0 +1,25 @@ +# 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` field ranging from `1` to `6` which +marks the importance of the feature. Less important places do not have a `rank`. +Use this to build a text hierarchy. The rank value originates from Natural Earth data and is either the +original `scalerank` for cities or the original `labelrank` for countries and states. +- **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/mapping.png b/layers/place/mapping.png new file mode 100644 index 0000000..ed7581c Binary files /dev/null and b/layers/place/mapping.png differ diff --git a/layers/place/mapping.yaml b/layers/place/mapping.yaml index 2c0303b..6f6264a 100644 --- a/layers/place/mapping.yaml +++ b/layers/place/mapping.yaml @@ -53,7 +53,7 @@ tables: place: - state city_point: - type: geometry + type: point fields: - name: osm_id type: id @@ -71,13 +71,12 @@ tables: filters: exclude_tags: - [ "name", "__nil__" ] - type_mappings: - points: - place: - - city - - town - - village - - hamlet - - suburb - - neighbourhood - - isolated_dwelling + mapping: + place: + - city + - town + - village + - hamlet + - suburb + - neighbourhood + - isolated_dwelling diff --git a/layers/place/place.yaml b/layers/place/place.yaml index 204f25f..f09c871 100644 --- a/layers/place/place.yaml +++ b/layers/place/place.yaml @@ -3,16 +3,25 @@ layer: description: | 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). - For countries, states and places at low zoom levels (`z0` to `z7`) the - [Populated Places](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/) dataset from NaturalEarth is merged - with OSM data to only show the most relevant places for the given zoom level. All features derived from NaturalEarth have a `scalerank` field. - States and countries additionally contain `postal` and `abbreviation` fields for styles that want to fit a lot of data with small labels on the map. - The `place` layer only contains more important states (or similar entities) from the US, Russia, China and Brazil. - + 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: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI. + name_en: The english `name:en` value if available. + 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). + rank: | + Countries, states and the most important cities all have a `rank` field ranging from `1` to `6` which + marks the importance of the feature. Less important places do not have a `rank`. + Use this to build a text hierarchy. The rank value originates from Natural Earth data and is either the + original `scalerank` for cities or the original `labelrank` for countries and states. buffer_size: 128 datasource: geometry_field: geometry - query: (SELECT geometry, name, name_en, class, abbrev scalerank FROM layer_place(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t + query: (SELECT geometry, name, name_en, class, rank FROM layer_place(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t schema: - ./types.sql - ./city.sql