Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e-road sorting issue #1493

Merged
merged 6 commits into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions integration-test/1483-e-road-sorting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- encoding: utf-8 -*-
from . import FixtureTest


class ERoadSortTest(FixtureTest):
def test_eroad_a90_e90(self):
# Sort A-road first, then e-road
self.load_fixtures(
['https://www.openstreetmap.org/way/188060822',
'https://www.openstreetmap.org/relation/2000662',
'https://www.openstreetmap.org/relation/2870369',
'https://www.openstreetmap.org/relation/2084465'])

# We could test on GRA shield_text but there's an unrelated bug
# We could test to ensure e-road network in all_networks
self.assert_has_feature(
16, 35043, 24378, 'roads',
{'id': 188060822, 'kind': 'highway', 'network': 'IT:A-road'})
2 changes: 2 additions & 0 deletions vectordatasource/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -4059,6 +4059,8 @@ def _road_network_importance(network, ref):
network_code = 1
elif network == 'US:US' or ':regional' in network:
network_code = 2
elif network == 'e-road' in network:
network_code = 9000
else:
network_code = len(network.split(':')) + 3

Expand Down