Brian Sperlongano d427d58e36
Water layer river mapping bug fixes (#1182)
This PR is a bugfix for the `water` layer.

* `waterway=stream`, `waterway=river`, `waterway=canal`, `waterway=ditch`, and `waterway=drain` are all linear features, not area features.  Thus, these objects are being unnecessarily mapped into the `osm_water_polygon` polygon table, and this PR removes these unneeded mappings.
* The combination `natural=water` + `water=river` is the most popular tagging for river areas.  However, the current mapping causes rivers tagged in this way to be rendered in the vector tiles as a `lake`.  This PR adds a check for the `water=river` tag and tags both variants of river areas as `class=river`.

`natural=water` + `water=river` river mapping:
![image](https://user-images.githubusercontent.com/3254090/129825551-388491de-549e-4843-80cc-01dba358c360.png)

`waterway=riverbank` river mapping:
![image](https://user-images.githubusercontent.com/3254090/129825618-4239eae7-a2bc-4a82-9931-fda2c02c2b40.png)


Lake mapping for a `natural=water` (with no other tagging):
![image](https://user-images.githubusercontent.com/3254090/129825554-9394b3d3-988a-4e92-a9f8-b198c695ec37.png)
2021-09-01 08:24:01 +02:00

47 lines
2.0 KiB
YAML

layer:
id: "water"
description: |
Water polygons representing oceans and lakes. Covered watered areas are excluded (`covered=yes`).
On low zoom levels 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.
On higher zoom levels water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) are used.
The polygons are 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:
description: |
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
Water bodies with the [`waterway=riverbank`](http://wiki.openstreetmap.org/wiki/Tag:waterway=riverbank)
or [`water=river`](http://wiki.openstreetmap.org/wiki/Tag:water=river) tag are classified as river. Wet and dry docks
tagged [`waterway=dock`](http://wiki.openstreetmap.org/wiki/Tag:waterway=dock) are classified as a `dock`.
All other water bodies are classified as `lake`.
values:
dock:
waterway: 'dock'
river:
water: 'river'
waterway: 'riverbank'
lake:
waterway: ''
ocean:
intermittent:
description: |
Mark with `1` if it is an [intermittent](http://wiki.openstreetmap.org/wiki/Key:intermittent) water polygon.
values: [0, 1]
brunnel:
description: |
Identifies the type of crossing as either a bridge or a tunnel.
values:
- bridge
- tunnel
buffer_size: 4
datasource:
query: (SELECT geometry, class, intermittent, brunnel FROM layer_water(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./update_water.sql
- ./water.sql
datasources:
- type: imposm3
mapping_file: ./mapping.yaml