-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the NE min zoom to cull places at low zooms. We were already usin…
…g the NE min zoom as the min_zoom property, but had failed to actually act on that by removing items outside of the zoom range.
- Loading branch information
1 parent
af16def
commit 0036211
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- encoding: utf-8 -*- | ||
from . import FixtureTest | ||
|
||
|
||
class LowZoomPlacesTest(FixtureTest): | ||
|
||
def test_zoom_1(self): | ||
import dsl | ||
|
||
z, x, y = (3, 7, 3) | ||
|
||
self.generate_fixtures( | ||
dsl.way(607976629, dsl.tile_centre_shape(z, x, y), { | ||
"min_zoom": 1, | ||
"__ne_max_zoom": 10, | ||
"__ne_min_zoom": 3, | ||
"area": 0, | ||
"place": "country", | ||
"name": "Guam", | ||
"population": 185427, | ||
"source": "openstreetmap.org", | ||
}), | ||
) | ||
|
||
# should exist at zoom 3 (the min zoom from NE) | ||
self.assert_has_feature( | ||
z, x, y, 'places', { | ||
'id': 607976629, | ||
'kind': 'country', | ||
'name': 'Guam', | ||
}) | ||
|
||
# should exist at zoom 2 (one past the min zoom) | ||
self.assert_has_feature( | ||
z-1, x//2, y//2, 'places', { | ||
'id': 607976629, | ||
'kind': 'country', | ||
'name': 'Guam', | ||
}) | ||
|
||
# should not exist at zoom 1 | ||
self.assert_no_matching_feature( | ||
z-2, x//4, y//4, 'places', { | ||
'id': 607976629, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters