Skip to content

Commit

Permalink
updates docs and create test for canal change (#2100)
Browse files Browse the repository at this point in the history
* update docs and create test for canal change
* Fixed test
  • Loading branch information
jeffdefacto authored Mar 3, 2023
1 parent ddc9c47 commit be63f57
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@ However, if the roads layer does not include `linear_ref_id`, then it should be

Water `polygons` representing oceans, riverbanks and lakes. Derived from a combination of the `waterway`, `natural`, and `landuse` OpenStreetMap tags. Includes coastline-derived water polygons from [osmdata.openstreetmap.de](https://osmdata.openstreetmap.de) and inland water directly from OpenStreetMap at higher zoom levels 8+, and [Natural Earth](http://naturalearthdata.com) polygons at lower zoom levels (0-7). Water polygons are progressively added based on an area filter until all water is shown at zoom 16+. Covered water is not included.

Also includes water `line` geometries for river and stream centerlines and "label_position" `points` for labeling polygons de-duplicated across tile boundaries. OpenStreetMap sourced waterway lines kinds of `river`, `canal`, and `stream` are included starting at zoom 11 and `ditch`, `drain` (zoom 16+).
Also includes water `line` geometries for river and stream centerlines and "label_position" `points` for labeling polygons de-duplicated across tile boundaries. OpenStreetMap sourced waterway lines with kinds of `river`, and `canal` with the tag `boat` = `yes` (aka navigable canals) are included starting at zoom 9, `stream` and other `canal` features are included starting at zoom 11, and `ditch`, `drain` (zoom 16+).

Tilezen calculates the composite exterior edge for overlapping water polygons and marks the resulting line `boundary=true`. Set to `true` when present on `line` geometry, or from Natural Earth line source.

Expand Down
46 changes: 46 additions & 0 deletions integration-test/2098-canal-min-zoom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import dsl

from . import FixtureTest


class TestCanalMinZoom(FixtureTest):
def test_canal(self):
z, x, y = (16, 10483, 25332)
self.generate_fixtures(
dsl.way(76287073, dsl.tile_box(z, x, y), {
'name': 'Ridenbaugh High Line Canal',
'boat': 'no',
'waterway': 'canal',
'source': 'openstreetmap.org'
})
)

self.assert_has_feature(
z, x, y, 'water',
{'id': 76287073,
'name': 'Ridenbaugh High Line Canal',
'kind': 'canal',
'min_zoom': 11,
'source': 'openstreetmap.org'})

def test_boat_canal(self):
z, x, y = (16, 10483, 25332)
self.generate_fixtures(
dsl.way(85123623, dsl.tile_box(z, x, y), {
'name': 'Canal de Bourgogne',
'access': 'boat',
'boat': 'yes',
'fishing': 'yes',
'waterway': 'canal',
'source': 'openstreetmap.org'
})
)

self.assert_has_feature(
z, x, y, 'water',
{'id': 85123623,
'name': 'Canal de Bourgogne',
'kind': 'canal',
'boat': 'yes',
'min_zoom': 9,
'source': 'openstreetmap.org'})

0 comments on commit be63f57

Please sign in to comment.