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:  `waterway=riverbank` river mapping:  Lake mapping for a `natural=water` (with no other tagging): 
This commit is contained in:
parent
0e17d53f42
commit
d427d58e36
@ -75,6 +75,9 @@ tables:
|
|||||||
- name: waterway
|
- name: waterway
|
||||||
key: waterway
|
key: waterway
|
||||||
type: string
|
type: string
|
||||||
|
- name: water
|
||||||
|
key: water
|
||||||
|
type: string
|
||||||
- name: is_intermittent
|
- name: is_intermittent
|
||||||
key: intermittent
|
key: intermittent
|
||||||
type: bool
|
type: bool
|
||||||
@ -95,11 +98,8 @@ tables:
|
|||||||
- bay
|
- bay
|
||||||
- spring
|
- spring
|
||||||
waterway:
|
waterway:
|
||||||
- river
|
|
||||||
- riverbank
|
- riverbank
|
||||||
- stream
|
|
||||||
- canal
|
|
||||||
- drain
|
|
||||||
- ditch
|
|
||||||
- dock
|
- dock
|
||||||
|
water:
|
||||||
|
- river
|
||||||
type: polygon
|
type: polygon
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
@ -1,8 +1,9 @@
|
|||||||
CREATE OR REPLACE FUNCTION water_class(waterway text) RETURNS text AS
|
CREATE OR REPLACE FUNCTION water_class(waterway text, water text) RETURNS text AS
|
||||||
$$
|
$$
|
||||||
SELECT CASE
|
SELECT CASE
|
||||||
|
WHEN waterway='riverbank' THEN 'river'
|
||||||
%%FIELD_MAPPING: class %%
|
%%FIELD_MAPPING: class %%
|
||||||
ELSE 'river'
|
ELSE 'lake'
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE SQL IMMUTABLE
|
$$ LANGUAGE SQL IMMUTABLE
|
||||||
PARALLEL SAFE;
|
PARALLEL SAFE;
|
||||||
@ -314,7 +315,7 @@ FROM osm_ocean_polygon_gen_z6
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z6 -> water_z6
|
-- etldoc: osm_water_polygon_gen_z6 -> water_z6
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -334,7 +335,7 @@ FROM osm_ocean_polygon_gen_z7
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z7 -> water_z7
|
-- etldoc: osm_water_polygon_gen_z7 -> water_z7
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -354,7 +355,7 @@ FROM osm_ocean_polygon_gen_z8
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z8 -> water_z8
|
-- etldoc: osm_water_polygon_gen_z8 -> water_z8
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -374,7 +375,7 @@ FROM osm_ocean_polygon_gen_z9
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z9 -> water_z9
|
-- etldoc: osm_water_polygon_gen_z9 -> water_z9
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -394,7 +395,7 @@ FROM osm_ocean_polygon_gen_z10
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z10 -> water_z10
|
-- etldoc: osm_water_polygon_gen_z10 -> water_z10
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -414,7 +415,7 @@ FROM osm_ocean_polygon_gen_z11
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon_gen_z11 -> water_z11
|
-- etldoc: osm_water_polygon_gen_z11 -> water_z11
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
NULL::boolean AS is_bridge,
|
NULL::boolean AS is_bridge,
|
||||||
NULL::boolean AS is_tunnel
|
NULL::boolean AS is_tunnel
|
||||||
@ -434,7 +435,7 @@ FROM osm_ocean_polygon_union
|
|||||||
UNION ALL
|
UNION ALL
|
||||||
-- etldoc: osm_water_polygon -> water_z12
|
-- etldoc: osm_water_polygon -> water_z12
|
||||||
SELECT geometry,
|
SELECT geometry,
|
||||||
water_class(waterway) AS class,
|
water_class(waterway, water) AS class,
|
||||||
is_intermittent,
|
is_intermittent,
|
||||||
is_bridge,
|
is_bridge,
|
||||||
is_tunnel
|
is_tunnel
|
||||||
|
|||||||
@ -12,14 +12,18 @@ layer:
|
|||||||
class:
|
class:
|
||||||
description: |
|
description: |
|
||||||
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
|
All water polygons from [OpenStreetMapData](http://osmdata.openstreetmap.de/) have the class `ocean`.
|
||||||
Water bodies with the [`waterway`](http://wiki.openstreetmap.org/wiki/Key:waterway) tag are classified as `lake`, `dock`, or `river`.
|
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`.
|
All other water bodies are classified as `lake`.
|
||||||
values:
|
values:
|
||||||
lake:
|
|
||||||
waterway: ['', 'lake']
|
|
||||||
dock:
|
dock:
|
||||||
waterway: 'dock'
|
waterway: 'dock'
|
||||||
river:
|
river:
|
||||||
|
water: 'river'
|
||||||
|
waterway: 'riverbank'
|
||||||
|
lake:
|
||||||
|
waterway: ''
|
||||||
ocean:
|
ocean:
|
||||||
intermittent:
|
intermittent:
|
||||||
description: |
|
description: |
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 43 KiB |
Loading…
x
Reference in New Issue
Block a user