-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to NE 5.1.2 - Add Config for new POVs (#2078)
* split lookup depending on whether it's a country (#2075) * return fclass_iso, fclass_tlc, and label_x, label_y for OSM features with matching NE features (#2082) * adding TLC POV to NE export, YAML files and transform.py (#2081) * adding tests * upgrading to 5.1.2 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
66740a3
commit 24c26c6
Showing
9 changed files
with
239 additions
and
58 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
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
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,102 @@ | ||
import dsl | ||
|
||
from . import FixtureTest | ||
|
||
|
||
class TestTLCPOV(FixtureTest): | ||
def test_tlc_ne_place(self): | ||
import dsl | ||
|
||
z, x, y = 16, 0, 0 | ||
|
||
self.generate_fixtures( | ||
dsl.way(1, dsl.tile_centre_shape(z, x, y), { | ||
'name': 'Foo', | ||
'featurecla': 'Admin-0 capital', | ||
'fclass_iso': 'Admin-1 capital', | ||
'fclass_tlc': 'Admin-0 capital', | ||
'scalerank': 4, | ||
'min_zoom': 4, | ||
'source': 'naturalearthdata.com', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'places', { | ||
'kind': 'locality', | ||
'country_capital': type(True), | ||
'country_capital:iso': type(False), | ||
'region_capital:iso': type(True), | ||
'country_capital:tlc': type(True), | ||
}) | ||
|
||
def test_tlc_ne_boundary(self): | ||
import dsl | ||
|
||
z, x, y = 16, 0, 0 | ||
|
||
self.generate_fixtures( | ||
dsl.way(1, dsl.tile_diagonal(z, x, y), { | ||
'name': 'Foo', | ||
'featurecla': 'Admin-1 region boundary', | ||
'fclass_iso': 'Admin-1 region boundary', | ||
'fclass_tlc': 'International boundary (verify)', | ||
'scalerank': 4, | ||
'min_zoom': 4, | ||
'source': 'naturalearthdata.com', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'boundaries', { | ||
'kind': 'macroregion', | ||
'kind:iso': 'macroregion', | ||
'kind:tlc': 'country', | ||
}) | ||
|
||
def test_osm_admin_level_viewpoint_tlc(self): | ||
z, x, y = (16, 39109, 26572) | ||
|
||
self.generate_fixtures( | ||
dsl.way(726514231, dsl.tile_diagonal(z, x, y), { | ||
'admin_level': '4', | ||
'admin_level:ISO': '8', | ||
'admin_level:TLC': '8', | ||
'boundary': 'disputed', | ||
'name': 'Viewpoints on Disputed Administrative Boundaries', | ||
'type': 'linestring', | ||
'source': 'openstreetmap.org', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'boundaries', { | ||
'id': 726514231, | ||
'kind': 'disputed_reference_line', | ||
'kind:iso': 'locality', | ||
'kind:tlc': 'locality', | ||
}) | ||
|
||
def test_osm_places_with_viewpoint_tlc(self): | ||
import dsl | ||
|
||
z, x, y = (10, 856, 441) | ||
|
||
self.generate_fixtures( | ||
dsl.point(432425099, (120.9820179, 23.9739374), { | ||
'name': 'Test place', | ||
'place': 'country', | ||
'place:ISO': 'state', | ||
'place:TLC': 'district', | ||
'source': 'openstreetmap.org', | ||
'source:sqkm': 'CIA World Factbook', | ||
}), | ||
) | ||
|
||
self.assert_has_feature( | ||
z, x, y, 'places', { | ||
'id': 432425099, | ||
'kind': 'country', | ||
'kind:iso': 'region', | ||
'kind:tlc': 'county' | ||
}) |
Oops, something went wrong.