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

roads layer thining z14 to z15 #2056

Merged
merged 17 commits into from
Feb 12, 2022
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
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
name: Check Code Style using pre-commit
command: |
. ~/env/bin/activate
pre-commit run --show-diff-on-failure --all-files
# we enabled pre-commit.ci for the repo so no need to run it on Circle here again
# pre-commit run --show-diff-on-failure --all-files
- run:
name: Setup.py develop
command: |
Expand Down
26 changes: 20 additions & 6 deletions integration-test/1062-road-shield-cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@ def _check_network_relation(
{'id': way_id, 'shield_text': expected_shield_text})

def test_A151(self):
self._check_network_relation(
way_id=208288552, rel_id=1159812, tile=(16, 32949, 22362),
expected_shield_text='A151')
tile = (16, 32949, 22362)
self.load_fixtures([
'https://www.openstreetmap.org/way/%d' % (208288552,),
'https://www.openstreetmap.org/relation/%d' % (1159812,),
], clip=self.tile_bbox(*tile))

z, x, y = tile
self.assert_has_feature(
z, x, y, 'roads',
{'id': type(None), 'shield_text': 'A151'})
Copy link
Contributor Author

@peitili peitili Feb 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nvkelso basically I copied the implementation of _check_network_relation and the only diffrence I made here is to assert 'id': type(None) instead. Before it asserts the id == way_id

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


def test_E402(self):
self._check_network_relation(
way_id=121496753, rel_id=88503, tile=(16, 32975, 22371),
expected_shield_text='E402')
tile = (16, 32975, 22371)
self.load_fixtures([
'https://www.openstreetmap.org/way/%d' % (121496753,),
'https://www.openstreetmap.org/relation/%d' % (88503,),
], clip=self.tile_bbox(*tile))

z, x, y = tile
self.assert_has_feature(
z, x, y, 'roads',
{'id': type(None), 'shield_text': 'E402'})

def test_A52(self):
self._check_network_relation(
Expand Down
8 changes: 5 additions & 3 deletions integration-test/1194-bus-route-refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def test_one_bus_route(self):
'bicycle_network': 'lcn',
'bicycle_shield_text': '50',
'bus_network': type(None),
'bus_shield_text': '23'})
'bus_shield_text': type(None),
'is_bus_related': True})

def test_inbound_and_outbound_routes(self):
# Jackson St. SF, part of trolley-bus route 3
Expand Down Expand Up @@ -114,9 +115,10 @@ def test_inbound_and_outbound_routes(self):
16, 10477, 25327, 'roads',
{'id': 225516711,
'bus_network': type(None),
'bus_shield_text': '3',
'bus_shield_text': type(None),
nvkelso marked this conversation as resolved.
Show resolved Hide resolved
'is_bus_related': True,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, the integ test says it should be None

'all_bus_networks': [type(None)],
'all_bus_shield_texts': ['3']})
'all_bus_shield_texts': [type(None)]})

def test_full_lists_disappear_by_zoom_12(self):
# make sure the all_* lists are gone by zoom 12 on major roads, but
Expand Down
2 changes: 1 addition & 1 deletion integration-test/1215-fix-bad-unicode-shield-text.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def test_cyrillic(self):

self.assert_has_feature(
16, 63085, 15623, 'roads',
{'id': -3948946, 'osm_relation': type(True),
{'id': -3948946, 'osm_relation': type(None),
'shield_text': u'77\u041a'})
2 changes: 1 addition & 1 deletion integration-test/1273-roads-access.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_no_access(self):
self.assert_has_feature(
12, 3344, 1785, 'roads',
{'kind': 'highway', 'kind_detail': 'motorway',
'alt_name:en': 'Shenzhen Bay Bridge', 'access': 'no'})
'alt_name:en': type(None), 'access': 'no'})

def test_access_yes(self):
# cycleway in Gdańsk, Poland
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def test_transform(self):

self.assert_has_feature(
16, 39650, 22780, 'roads',
{'id': 239860289, 'name:en': 'Illicha Avenue',
{'id': 239860289, 'name:en': type(None),
'kind': 'major_road', 'surface': 'cobblestone_flattened'})
4 changes: 2 additions & 2 deletions integration-test/1491-argentina-shields.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_ruta_nacional_shield_text(self):
self.assert_has_feature(
z, x, y, 'roads',
{'id': 1, 'kind': 'highway', 'network': 'AR:national',
'ref': 'RNA002', 'shield_text': 'A002'})
'ref': type(None), 'shield_text': 'A002'})

def test_ruta_provincial_shield_text(self):
import dsl
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_ruta_provincial_shield_text(self):
self.assert_has_feature(
z, x, y, 'roads',
{'id': 1, 'kind': 'major_road', 'network': 'AR:provincial',
'ref': 'RP21', 'shield_text': '21'})
'ref': type(None), 'shield_text': '21'})

# same as the test above, but using the country backfill rather than
# the relation.
Expand Down
8 changes: 5 additions & 3 deletions integration-test/1979-shield-text-length.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ def test_create_shield_text_length(self):
'shield_text_length': '2',
'bicycle_shield_text': '50',
'bicycle_shield_text_length': '2',
'bus_shield_text': '23',
'bus_shield_text_length': '2'
'is_bus_related': True,
'bus_shield_text': type(None),
nvkelso marked this conversation as resolved.
Show resolved Hide resolved
'bus_shield_text_length': type(None),
})

# make sure text length is encoded as a string
Expand Down Expand Up @@ -120,7 +121,8 @@ def test_lengths_over_6_or_empty_are_not_reported(self):
'shield_text': '123456',
'shield_text_length': '6',
'bicycle_shield_text': '1234567',
'bus_shield_text': '',
'bus_shield_text': type(None),
nvkelso marked this conversation as resolved.
Show resolved Hide resolved
'is_bus_related': True,
})

self.assert_no_matching_feature(z, x, y, 'roads', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def test_address_point_falls_back_to_name(self):
# if there is no housenumber, and the building name is not just a number, don't make an address point
def test_no_address_point_if_no_usable_address(self):
import dsl

z, x, y = (16, 19299, 24630)

self.generate_fixtures(
Expand Down
12 changes: 6 additions & 6 deletions integration-test/546-road-sort-keys-bridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_motorway_bridge(self):
self.assert_has_feature(
16, 10472, 25323, 'roads',
{'kind': 'highway', 'kind_detail': 'motorway', 'id': 28412298,
'name': 'Presidio Pkwy.', 'is_bridge': True, 'sort_rank': 443})
'name': type(None), 'is_bridge': True, 'sort_rank': 443})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the feature is too short to fit the label, while at zoom 17 it would fit / we don't drop.


def test_trunk_bridge(self):
self.generate_fixtures(dsl.way(59801274, wkt_loads('LINESTRING (-122.479362893599 37.77087721656759, -122.479200837522 37.77058011511458)'), {u'bridge': u'yes', u'layer': u'1', u'maxspeed': u'35 mph', u'lanes': u'3', u'name': u'Crossover Drive', u'tiger:cfcc': u'A35', u'source': u'openstreetmap.org', u'hgv': u'designated',
Expand All @@ -22,7 +22,7 @@ def test_trunk_bridge(self):
self.assert_has_feature(
16, 10471, 25331, 'roads',
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': 59801274,
'name': 'Crossover Dr.', 'is_bridge': True, 'sort_rank': 443})
'name': type(None), 'is_bridge': True, 'sort_rank': 443})

def test_primary_bridge(self):
self.generate_fixtures(dsl.way(399640204, wkt_loads('LINESTRING (-118.117754009656 33.8102109201601, -118.117900794373 33.80993729058998)'), {u'bridge': u'yes', u'tiger:name_base': u'Los Coyotes Diagonal', u'lanes': u'2', u'name': u'North Los Coyotes Diagonal',
Expand All @@ -31,7 +31,7 @@ def test_primary_bridge(self):
self.assert_has_feature(
16, 11265, 26221, 'roads',
{'kind': 'major_road', 'kind_detail': 'primary', 'id': 399640204,
'name': 'North Los Coyotes Diagonal', 'is_bridge': True,
'name': type(None), 'is_bridge': True,
'sort_rank': 430})

def test_secondary_bridge(self):
Expand All @@ -41,7 +41,7 @@ def test_secondary_bridge(self):
self.assert_has_feature(
16, 10486, 25339, 'roads',
{'kind': 'major_road', 'kind_detail': 'secondary', 'id': 27613581,
'name': 'Oakdale Ave.', 'is_bridge': True, 'sort_rank': 429})
'name': type(None), 'is_bridge': True, 'sort_rank': 429})

def test_teriary_bridge(self):
self.generate_fixtures(dsl.way(242940297, wkt_loads('LINESTRING (-122.395271869347 37.7907203080898, -122.395156974822 37.79062745343989, -122.394827562608 37.79036145403797)'), {
Expand All @@ -50,7 +50,7 @@ def test_teriary_bridge(self):
self.assert_has_feature(
16, 10486, 25327, 'roads',
{'kind': 'major_road', 'kind_detail': 'tertiary', 'id': 242940297,
'name': 'Beale St.', 'is_bridge': True, 'sort_rank': 427})
'name': type(None), 'is_bridge': True, 'sort_rank': 427})

def test_residential_bridge(self):
self.generate_fixtures(dsl.way(162038104, wkt_loads('LINESTRING (-121.009686569766 39.24352031486828, -121.009910968924 39.24385926543338)'), {
Expand All @@ -59,7 +59,7 @@ def test_residential_bridge(self):
self.assert_has_feature(
16, 10738, 24989, 'roads',
{'kind': 'minor_road', 'kind_detail': 'residential',
'id': 162038104, 'name': 'Woodwardia Pl.', 'sort_rank': 410})
'id': 162038104, 'name': type(None), 'sort_rank': 410})

def test_service_bridge(self):
self.generate_fixtures(dsl.way(232303398, wkt_loads('LINESTRING (-122.416602904758 37.63546055316739, -122.416466181171 37.63550956768369)'), {
Expand Down
6 changes: 3 additions & 3 deletions integration-test/546-road-sort-keys-roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_motorway(self):
self.assert_has_feature(
16, 10472, 25323, 'roads',
{'kind': 'highway', 'kind_detail': 'motorway', 'id': 26765956,
'name': 'Presidio Pkwy.', 'sort_rank': 383})
'name': type(None), 'sort_rank': 383})

def test_trunk(self):
self.generate_fixtures(dsl.way(65310628, wkt_loads('POINT (-122.475980826386 37.74678596946688)'), {u'source': u'openstreetmap.org', u'highway': u'traffic_signals'}), dsl.way(65316090, wkt_loads('POINT (-122.476110093955 37.74865039228589)'), {u'source': u'openstreetmap.org', u'highway': u'traffic_signals'}), dsl.way(89802409, wkt_loads('LINESTRING (-122.476110093955 37.74865039228589, -122.475980826386 37.74678596946688)'), {
Expand All @@ -41,7 +41,7 @@ def test_secondary(self):
self.assert_has_feature(
16, 10482, 25332, 'roads',
{'kind': 'major_road', 'kind_detail': 'secondary', 'id': 25337673,
'name': 'Mission St.', 'sort_rank': 379})
'name': type(None), 'sort_rank': 379})

def test_tertiary(self):
self.generate_fixtures(dsl.way(65322629, wkt_loads('POINT (-122.40181420973 37.80231791588138)'), {u'source': u'openstreetmap.org', u'highway': u'traffic_signals'}), dsl.way(65333972, wkt_loads('POINT (-122.401067530066 37.79858441788151)'), {u'source': u'openstreetmap.org', u'turn_restrictions': u'no', u'highway': u'traffic_signals'}), dsl.way(3645272798, wkt_loads('POINT (-122.401086484518 37.79867910806588)'), {u'crossing': u'traffic_signals', u'source': u'openstreetmap.org', u'highway': u'crossing'}), dsl.way(255330035, wkt_loads(
Expand All @@ -68,7 +68,7 @@ def test_residential(self):
self.assert_has_feature(
16, 10485, 25344, 'roads',
{'kind': 'minor_road', 'kind_detail': 'residential', 'id': 8919312,
'name': 'Racine Ln.', 'sort_rank': 360})
'name': type(None), 'sort_rank': 360})

def test_service(self):
self.generate_fixtures(dsl.way(59161514, wkt_loads('LINESTRING (-122.4472244965 37.80663996058681, -122.44711463254 37.8067056828995, -122.446758001373 37.80679809149498, -122.446403795656 37.80689000315549, -122.446004135186 37.80698539243338, -122.444982211719 37.80729270973048, -122.444909807507 37.80734345599718, -122.444832013403 37.80740499023472)'), {
Expand Down
16 changes: 8 additions & 8 deletions integration-test/546-road-sort-keys-tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_motorway_level_0(self):
self.assert_has_feature(
16, 10475, 25324, 'roads',
{'kind': 'highway', 'kind_detail': 'motorway', 'id': 167952621,
'name': 'Presidio Pkwy.', 'is_tunnel': True, 'sort_rank': 333})
'name': type(None), 'is_tunnel': True, 'sort_rank': 333})

def test_trunk_level_0(self):
self.generate_fixtures(dsl.way(259492789, wkt_loads('LINESTRING (-74.16702601822249 40.73275266220829, -74.16711180733211 40.73254919807029)'), {u'tunnel': u'yes', u'tiger:name_base': u'McCarter', u'hgv:state_network': u'yes', u'name': u'McCarter Highway', u'tiger:cfcc': u'A35', u'tiger:name_base_1': u'State Route 21', u'hgv': u'designated', u'tiger:zip_left': u'07104',
Expand All @@ -23,15 +23,15 @@ def test_trunk_level_0(self):
self.assert_has_feature(
16, 19266, 24635, 'roads',
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': 259492789,
'name': 'McCarter Hwy.', 'is_tunnel': True, 'sort_rank': 331})
'name': type(None), 'is_tunnel': True, 'sort_rank': 331})

self.generate_fixtures(dsl.way(277441866, wkt_loads('LINESTRING (-83.51858074221251 35.74467572285489, -83.5186876417313 35.74474476841309, -83.51881250755579 35.74482300053089, -83.5189321631516 35.74490640915329, -83.51904642885579 35.74499477553549, -83.51915494534208 35.74508795384219, -83.51925717362138 35.74518557950971, -83.5193531136938 35.74528736088479, -83.519442406233 35.74539315213308, -83.51952478174461 35.74550258869337, -83.5196001503969 35.74561537891499, -83.5196680630324 35.74573115823921, -83.51972860948248 35.745849707927, -83.51978143042119 35.7459706634228, -83.519826436017 35.74609380599009, -83.51986353643818 35.74621847944319, -83.51989255202189 35.74634468377489, -83.519913482768 35.746471981529, -83.51992632867659 35.74660000815989, -83.51993082025298 35.74672825330868)'), {
u'unsigned_ref': u'SR 71;SR 73', u'lanes': u'2', u'name': u'Gatlinburg Spur Road (north)', u'tunnel': u'yes', u'surface': u'paved', u'source': u'openstreetmap.org', u'official_name': u'Gatlinburg Spur Road (north)', u'NHS': u'yes', u'oneway': u'yes', u'ref': u'US 321;US 441', u'highway': u'trunk'}))

self.assert_has_feature(
16, 17563, 25792, 'roads',
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': 277441866,
'name': 'Gatlinburg Spur Road (north)', 'is_tunnel': True,
'name': type(None), 'is_tunnel': True,
'sort_rank': 331})

def test_primary_level_0(self):
Expand All @@ -41,7 +41,7 @@ def test_primary_level_0(self):
self.assert_has_feature(
16, 16808, 24434, 'roads',
{'kind': 'major_road', 'kind_detail': 'primary', 'id': 117837633,
'name': 'Dixie Hwy.', 'is_tunnel': True, 'sort_rank': 330})
'name': type(None), 'is_tunnel': True, 'sort_rank': 330})

def test_secondary_level_0(self):
self.generate_fixtures(dsl.way(57782075, wkt_loads('LINESTRING (-87.64371486497609 41.7396067862949, -87.64368198663669 41.73869201695129)'), {u'tiger:source': u'tiger_import_dch_v0.6_20070809', u'tiger:name_base': u'Halsted', u'name': u'South Halsted Street', u'tiger:cfcc': u'A41', u'tiger:separated': u'no', u'tunnel': u'yes',
Expand All @@ -50,7 +50,7 @@ def test_secondary_level_0(self):
self.assert_has_feature(
16, 16812, 24391, 'roads',
Copy link
Member

@nvkelso nvkelso Feb 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you updated this to 17, 33624, 48782 then the name would still be there, but it's fine this way.

{'kind': 'major_road', 'kind_detail': 'secondary', 'id': 57782075,
'name': 'S Halsted St.', 'is_tunnel': True, 'sort_rank': 329})
'name': type(None), 'is_tunnel': True, 'sort_rank': 329})

def test_teriary_level_0(self):
self.generate_fixtures(dsl.way(57708079, wkt_loads('LINESTRING (-87.63913570281528 41.75983047016649, -87.63944553175681 41.75982631559528)'), {u'tiger:source': u'tiger_import_dch_v0.6_20070809', u'tiger:name_base': u'74th', u'name': u'West 74th Street', u'tiger:cfcc': u'A41', u'tiger:separated': u'no', u'tunnel': u'yes', u'tiger:zip_left': u'60636', u'tiger:zip_right': u'60636', u'tiger:reviewed': u'no',
Expand All @@ -59,7 +59,7 @@ def test_teriary_level_0(self):
self.assert_has_feature(
16, 16813, 24386, 'roads',
{'kind': 'major_road', 'kind_detail': 'tertiary', 'id': 57708079,
'name': 'W 74th St.', 'is_tunnel': True, 'sort_rank': 327})
'name': type(None), 'is_tunnel': True, 'sort_rank': 327})

def test_residential_level_0(self):
self.generate_fixtures(dsl.way(56393654, wkt_loads('LINESTRING (-87.6687173149529 41.85966997294218, -87.66872872355698 41.86017336309299)'), {u'tiger:source': u'tiger_import_dch_v0.6_20070809', u'tiger:name_base': u'Paulina', u'bicycle': u'yes', u'name': u'South Paulina Street', u'tiger:cfcc': u'A41', u'tiger:separated': u'no', u'tunnel': u'yes', u'tiger:zip_left': u'60608', u'tiger:zip_right': u'60608', u'tiger:reviewed': u'no',
Expand All @@ -68,7 +68,7 @@ def test_residential_level_0(self):
self.assert_has_feature(
16, 16808, 24362, 'roads',
{'kind': 'minor_road', 'kind_detail': 'residential',
'id': 56393654, 'name': 'S Paulina St.', 'is_tunnel': True,
'id': 56393654, 'name': type(None), 'is_tunnel': True,
'sort_rank': 310})

def test_service_level_0(self):
Expand All @@ -78,4 +78,4 @@ def test_service_level_0(self):
self.assert_has_feature(
16, 16814, 24363, 'roads',
{'kind': 'minor_road', 'kind_detail': 'service', 'id': 190835369,
'name': 'S Wong Pkwy.', 'is_tunnel': True, 'sort_rank': 308})
'name': type(None), 'is_tunnel': True, 'sort_rank': 308})
4 changes: 2 additions & 2 deletions integration-test/629-trolleybus-is-a-bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_industrial_street(self):

self.assert_has_feature(
16, 10484, 25339, 'roads',
{'is_bus_route': True, 'name': 'Industrial St.'})
{'is_bus_route': True, 'name': type(None)})

def test_clayton_street(self):
self.load_fixtures([
Expand All @@ -20,7 +20,7 @@ def test_clayton_street(self):

self.assert_has_feature(
16, 10477, 25333, 'roads',
{'is_bus_route': True, 'name': 'Clayton St.'})
{'is_bus_route': True, 'name': type(None)})

def test_union_street(self):
import dsl
Expand Down
4 changes: 2 additions & 2 deletions integration-test/647-cycle-route.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_west_national_avenue(self):

self.assert_has_feature(
16, 16842, 24939, 'roads',
{'id': 95578389, 'kind': 'major_road', 'bicycle_network': 'ncn'})
{'id': type(None), 'kind': 'major_road', 'bicycle_network': 'ncn'})

def test_kananaskis_trail(self):
# Way: Kananaskis Trail (385652955)
Expand Down Expand Up @@ -202,7 +202,7 @@ def test_foothill_expressway(self):

self.assert_has_feature(
16, 10535, 25419, 'roads',
{'id': 173846425, 'kind': 'major_road', 'bicycle_network': 'lcn'})
{'id': type(None), 'kind': 'major_road', 'bicycle_network': 'lcn'})

def test_segregated(self):
self.load_fixtures(['http://www.openstreetmap.org/way/255652148'])
Expand Down
4 changes: 2 additions & 2 deletions integration-test/766-dont-merge-z16-roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def test_roads_not_merged(self):

self.assert_has_feature(
16, 19829, 24234, 'roads',
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': 89912879})
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': type(None)})

self.assert_has_feature(
16, 19829, 24234, 'roads',
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': 89911760})
{'kind': 'major_road', 'kind_detail': 'trunk', 'id': type(None)})
4 changes: 2 additions & 2 deletions integration-test/988-add-collision-rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ def test_road_ref(self):
'kind': 'minor_road',
'name': type(None),
'shield_text': type(None),
'ref': '1',
'collision_rank': int,
'ref': type(None),
'collision_rank': type(None),
})

def test_road_shield_text(self):
Expand Down
Loading