Skip to content

Commit

Permalink
Merge pull request #1819 from tilezen/zerebububth/1813-landcover-land…
Browse files Browse the repository at this point in the history
…use-zoom-9

Change some min zooms for landcover-ish landuses.
  • Loading branch information
zerebubuth authored Feb 6, 2019
2 parents ef19414 + 52f25fe commit 5439c23
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 6 deletions.
2 changes: 1 addition & 1 deletion integration-test/1794-demote-early-landcover.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_residential(self):
z, x, y, 'landuse', {
'id': 6612640,
'kind': 'residential',
'min_zoom': 9,
'min_zoom': 10,
})

def _check_min_zoom(self, tags, kind, min_zoom, tile_zoom=14):
Expand Down
98 changes: 98 additions & 0 deletions integration-test/1813-landcover-landuse-zoom-9.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# -*- encoding: utf-8 -*-
from . import FixtureTest


class LandcoverTest(FixtureTest):

def _starts_at(self, zoom, props):
import dsl

all_props = {'source': 'openstreetmap.org'}
all_props.update(props)

# biggest polygon possible - covering the whole world - should be
# visible at this zoom, and have a min zoom of this zoom.
world = dsl.tile_box(0, 0, 0)
self.generate_fixtures(dsl.way(1, world, all_props))

self.assert_has_feature(
zoom, 0, 0, 'landuse', {
'min_zoom': zoom,
})

def test_landuse_farmland(self):
# farmland (and farm), modify the min to be 9 instead of 10.
self._starts_at(9, {'landuse': 'farmland'})
self._starts_at(9, {'landuse': 'farm'})

def test_landuse_orchard(self):
# starts at 10 now, should be 9?
self._starts_at(9, {'landuse': 'orchard'})

def test_landuse_forest(self):
# do we need a custom `tier2_min_zoom` to show all at zoom 9?
self._starts_at(9, {'landuse': 'forest'})

def test_landuse_residential(self):
# okay to start at 10, because of NE overlap
self._starts_at(10, {'landuse': 'residential'})

def test_landuse_commercial(self):
# okay to start at 10, because of NE overlap
self._starts_at(10, {'landuse': 'commercial'})

def test_landuse_retail(self):
# okay to start at 10, because of NE overlap
self._starts_at(10, {'landuse': 'retail'})

def test_landuse_industrial(self):
# okay to start at 10, because of NE overlap
self._starts_at(10, {'landuse': 'industrial'})

def test_landuse_meadow(self):
# starts at 9, but throttled
self._starts_at(9, {'landuse': 'meadow'})

def test_landuse_vineyard(self):
# starts at 9, but throttled
self._starts_at(9, {'landuse': 'vineyard'})

def test_natural_wood(self):
# do we need a custom `tier2_min_zoom` to show all at zoom 9?
self._starts_at(9, {'natural': 'wood'})

def test_natural_sand(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'sand'})

def test_natural_scree(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'scree'})

def test_natural_shingle(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'shingle'})

def test_natural_bare_rock(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'bare_rock'})

def test_natural_heath(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'heath'})

def test_natural_grassland(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'grassland'})

def test_natural_scrub(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'scrub'})

def test_natural_wetland(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'wetland'})

def test_natural_mud(self):
# starts at 9, but throttled
self._starts_at(9, {'natural': 'mud'})
10 changes: 5 additions & 5 deletions yaml/landuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ filters:
# few things in advance which seem to be more specific.
############################################################
- filter: {natural: wetland}
min_zoom: { max: [ 9, *tier4_min_zoom ] }
min_zoom: { max: [ 9, *tier2_min_zoom ] }
output:
<<: *output_properties
kind: wetland
Expand Down Expand Up @@ -557,20 +557,20 @@ filters:
kind: rural
tier: 2
- filter: {landuse: residential}
min_zoom: { max: [ 9, *tier2_min_zoom ] }
min_zoom: { max: [ 10, *tier2_min_zoom ] }
output:
<<: *output_properties
kind: residential
tier: 2

- filter: { landuse: farm }
min_zoom: { max: [ 10, *tier2_min_zoom ] }
min_zoom: { max: [ 9, *tier2_min_zoom ] }
output:
<<: *output_properties
kind: farm
tier: 2
- filter: { landuse: farmland }
min_zoom: { max: [ 10, *tier2_min_zoom ] }
min_zoom: { max: [ 9, *tier2_min_zoom ] }
output:
<<: *output_properties
kind: farmland
Expand Down Expand Up @@ -928,7 +928,7 @@ filters:
then: {col: surface}
# orchard
- filter: { landuse: orchard }
min_zoom: *tier5_min_zoom
min_zoom: { max: [ 9, *tier2_min_zoom ] }
output:
<<: *output_properties
kind: orchard
Expand Down

0 comments on commit 5439c23

Please sign in to comment.