Documnt place

This commit is contained in:
lukasmartinelli 2016-10-29 11:15:13 +02:00
parent ab4413e209
commit 6f915eca92
5 changed files with 55 additions and 20 deletions

View File

@ -1,8 +1,7 @@
all: build/openmaptiles.tm2source/data.yml build/mapping.yaml build/tileset.sql all: build/openmaptiles.tm2source/data.yml build/mapping.yaml build/tileset.sql
.PHONY: docs .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: 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 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: layers/building/README.md:
generate-doc layers/building/building.yaml > 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: 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 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

25
layers/place/README.md Normal file
View File

@ -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)

BIN
layers/place/mapping.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -53,7 +53,7 @@ tables:
place: place:
- state - state
city_point: city_point:
type: geometry type: point
fields: fields:
- name: osm_id - name: osm_id
type: id type: id
@ -71,8 +71,7 @@ tables:
filters: filters:
exclude_tags: exclude_tags:
- [ "name", "__nil__" ] - [ "name", "__nil__" ]
type_mappings: mapping:
points:
place: place:
- city - city
- town - town

View File

@ -3,16 +3,25 @@ layer:
description: | description: |
The place layer consists out of [countries](http://wiki.openstreetmap.org/wiki/Tag:place%3Dcountry), 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). [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 Apart from the roads this is also one of the more important layers to create a beautiful map.
[Populated Places](http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-populated-places/) dataset from NaturalEarth is merged We suggest you use different font styles and sizes to create a text hierarchy.
with OSM data to only show the most relevant places for the given zoom level. All features derived from NaturalEarth have a `scalerank` field. fields:
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. name: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the POI.
The `place` layer only contains more important states (or similar entities) from the US, Russia, China and Brazil. 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 buffer_size: 128
datasource: datasource:
geometry_field: geometry 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: schema:
- ./types.sql - ./types.sql
- ./city.sql - ./city.sql