openmaptiles/layers/landcover/landcover.yaml
Tomas Pohanka 4a1b0afa26
reworked landcover layer (#1035)
Instead of using [Douglas-Peucker algorithm](https://postgis.net/docs/ST_SimplifyPreserveTopology.html) which is using for generalized tables [imposm](https://imposm.org/docs/imposm3/latest/mapping.html#generalized-tables) it is used [Visvalingam-Whyatt algorithm](https://postgis.net/docs/ST_SimplifyVW.html).

Solution:
remove imposm generalized tables (during `import-osm`) and create generalization in `import-sql` step for zooms 7-14. Zooms 0-6 are from Natural Earth data.

Upper zoom levels (7 and 8) are ok to merge with no big impact on creation speed. In Canada from z9 it took too long. Between zoom levels 10 - 13 there can be union polygons with less than 300 edge points (empirical number based on a test on Canada forest, can be discussed). Polygons with more than 300 edge points are just simplified. Zoom 14 is from the original dataset `osm_landcover_polygon`.

There is also removed `osm_id` which is never used and not passed into vector tiles.
2020-11-11 15:11:48 +02:00

81 lines
2.5 KiB
YAML

layer:
id: "landcover"
description: |
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](http://wiki.openstreetmap.org/wiki/Landcover). The most common use case for this layer
is to style wood (`class=wood`) and grass (`class=grass`) areas.
buffer_size: 4
fields:
class:
description: |
Use the **class** to assign natural colors for **landcover**.
values:
farmland:
subclass: ['farmland', 'farm', 'orchard', 'vineyard', 'plant_nursery']
ice:
subclass: ['glacier', 'ice_shelf']
wood:
subclass: ['wood', 'forest']
rock:
subclass: ['bare_rock', 'scree']
grass:
subclass: ['fell', 'grassland', 'heath', 'scrub', 'tundra', 'grass', 'meadow', 'allotments', 'park', 'village_green', 'recreation_ground', 'garden', 'golf_course']
wetland:
subclass: ['wetland', 'bog', 'swamp', 'wet_meadow', 'marsh', 'reedbed', 'saltern', 'tidalflat', 'saltmarsh', 'mangrove']
sand:
subclass: ['beach', 'sand', 'dune']
subclass:
description: |
Use **subclass** to do more precise styling.
Original value of either the
[`natural`](http://wiki.openstreetmap.org/wiki/Key:natural),
[`landuse`](http://wiki.openstreetmap.org/wiki/Key:landuse),
[`leisure`](http://wiki.openstreetmap.org/wiki/Key:leisure),
or [`wetland`](http://wiki.openstreetmap.org/wiki/Key:wetland) tag.
values:
- allotments
- bare_rock
- beach
- bog
- dune
- scrub
- farm
- farmland
- fell
- forest
- garden
- glacier
- grass
- grassland
- golf_course
- heath
- mangrove
- marsh
- meadow
- orchard
- park
- plant_nursery
- recreation_ground
- reedbed
- saltern
- saltmarsh
- sand
- scree
- swamp
- tidalflat
- tundra
- village_green
- vineyard
- wet_meadow
- wetland
- wood
datasource:
geometry_field: geometry
query: (SELECT geometry, class, subclass FROM layer_landcover(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./generalized.sql
- ./landcover.sql
datasources:
- type: imposm3
mapping_file: ./mapping.yaml