-
Notifications
You must be signed in to change notification settings - Fork 121
earlier bike roads (and walking routes) #1198
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
Changes from 39 commits
797ce83
0d14324
54228ed
9bd8ad6
826a239
27a5926
647c277
e67e6b5
d380e9a
646a3af
80f4c1d
7421acc
25eab5d
5d75b16
459d64d
5a87cc5
55776eb
e6817df
bd1c818
671b226
117f5f6
ea3f5b8
a07982e
a237eb2
b620cc5
35a7b71
1bf4eca
a4513a9
5ab7d86
c5ce01c
c1b1193
9baa1be
94d7818
ec081ec
36dba96
27f5ef5
f68e5fa
80c480c
999f5fb
392c88e
7cd5ffc
c818d12
3c620cd
c9fd198
bcf8ada
23f6d91
3612214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
UPDATE planet_osm_line | ||
SET mz_road_level = mz_calculate_min_zoom_roads(planet_osm_line.*) | ||
WHERE | ||
(tags -> 'highway' IN ( 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', | ||
'residential', 'unclassified', 'road', 'living_street', 'pedestrian', | ||
'path', 'track', 'cycleway', 'bridleway', 'footway', 'steps', | ||
'service' ) OR | ||
tags -> 'whitewater' = 'portage_way') | ||
AND mz_calculate_min_zoom_roads(planet_osm_line.*) IS NOT NULL; | ||
|
||
CREATE INDEX new_planet_osm_line_roads_geom_index ON planet_osm_line USING gist(way) WHERE mz_road_level IS NOT NULL; | ||
CREATE INDEX new_planet_osm_line_roads_geom_9_index ON planet_osm_line USING gist(way) WHERE mz_road_level <= 9; | ||
CREATE INDEX new_planet_osm_line_roads_geom_12_index ON planet_osm_line USING gist(way) WHERE mz_road_level <= 12; | ||
CREATE INDEX new_planet_osm_line_roads_geom_15_index ON planet_osm_line USING gist(way) WHERE mz_road_level <= 15; | ||
|
||
BEGIN; | ||
DROP INDEX IF EXISTS planet_osm_line_roads_geom_index; | ||
ALTER INDEX new_planet_osm_line_roads_geom_index RENAME TO planet_osm_line_roads_geom_index; | ||
COMMIT; | ||
|
||
BEGIN; | ||
DROP INDEX IF EXISTS planet_osm_line_roads_geom_9_index; | ||
ALTER INDEX new_planet_osm_line_roads_geom_9_index RENAME TO planet_osm_line_roads_geom_9_index; | ||
COMMIT; | ||
|
||
BEGIN; | ||
DROP INDEX IF EXISTS planet_osm_line_roads_geom_12_index; | ||
ALTER INDEX new_planet_osm_line_roads_geom_12_index RENAME TO planet_osm_line_roads_geom_12_index; | ||
COMMIT; | ||
|
||
BEGIN; | ||
DROP INDEX IF EXISTS planet_osm_line_roads_geom_15_index; | ||
ALTER INDEX new_planet_osm_line_roads_geom_15_index RENAME TO planet_osm_line_roads_geom_15_index; | ||
COMMIT; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# highway=path, with route inter-national | ||
# GR5-Grand Traverse de Jura between France and Switzerland | ||
# https://www.openstreetmap.org/way/285975282 | ||
# https://www.openstreetmap.org/relation/6009161 | ||
assert_has_feature( | ||
9, 265, 179, 'roads', | ||
{ 'kind': 'path', 'walking_network': 'iwn' } ) | ||
|
||
# highway=path, with route national (Pacific Crest Trail) at zoom 9 | ||
# https://www.openstreetmap.org/way/236361475 | ||
# https://www.openstreetmap.org/relation/1225378 | ||
assert_has_feature( | ||
9, 86, 197, 'roads', | ||
{ 'kind': 'path', 'walking_network': 'nwn' } ) | ||
|
||
# highway=path, with route regional (Merced Pass Trail) at zoom 11 | ||
# https://www.openstreetmap.org/way/373491941 | ||
# https://www.openstreetmap.org/relation/5549623 | ||
assert_has_feature( | ||
11, 343, 792, 'roads', | ||
{ 'kind': 'path', 'walking_network': 'rwn' } ) | ||
|
||
# highway=unclassified, with route local (Grant Avenue) at zoom 12 | ||
# part of The Barbary Coast Trail in San Francisco | ||
# https://www.openstreetmap.org/way/91181758 | ||
# https://www.openstreetmap.org/relation/6322028 | ||
assert_has_feature( | ||
12, 655, 1582, 'roads', | ||
{ 'kind': 'minor_road', 'walking_network': 'lwn' } ) | ||
|
||
# Way: North Sea Cycle Route - part Netherlands (1977662) | ||
# A really long highway=cycleway | ||
# https://www.openstreetmap.org/way/35568189 | ||
# https://www.openstreetmap.org/relation/1977662 | ||
# https://www.openstreetmap.org/relation/1975739 | ||
# https://www.openstreetmap.org/relation/5294 | ||
# https://www.openstreetmap.org/relation/537418 | ||
assert_has_feature( | ||
8, 131, 83, 'roads', | ||
{ 'kind': 'path', 'is_bicycle_related': True, 'bicycle_network': 'icn' }) | ||
|
||
# Ferry between Denmark and Germany, icn | ||
# https://www.openstreetmap.org/way/128631318 | ||
# https://www.openstreetmap.org/relation/721738 | ||
assert_has_feature( | ||
8, 136, 81, 'roads', | ||
{ 'kind': 'ferry', 'is_bicycle_related': True, 'bicycle_network': 'icn' }) | ||
|
||
# Søndervangsvej minor road in Denmark as national cycle route | ||
# https://www.openstreetmap.org/way/149701891 | ||
# https://www.openstreetmap.org/relation/349521 | ||
assert_has_feature( | ||
8, 136, 79, 'roads', | ||
{ 'kind': 'minor_road', 'is_bicycle_related': True, 'bicycle_network': 'ncn' }) | ||
|
||
# Part of Bay Trail in South (San Francisco) Bay | ||
# way is marked rcn=yes, and part of a proper bike relation | ||
# http://www.openstreetmap.org/way/44422697 | ||
# http://www.openstreetmap.org/relation/325779 | ||
assert_has_feature( | ||
10, 164, 396, 'roads', | ||
{ 'kind': 'path', 'is_bicycle_related': True, 'bicycle_network': 'rcn' }) | ||
|
||
# Hyltebjerg Allé residential road with rcn in Copenhagen | ||
# https://www.openstreetmap.org/way/2860759 | ||
# https://www.openstreetmap.org/relation/2087590 | ||
assert_has_feature( | ||
10, 547, 320, 'roads', | ||
{ 'kind': 'minor_road', 'is_bicycle_related': True, 'bicycle_network': 'rcn' }) | ||
|
||
# lcn in Seattle (living street that would only be visible at zoom 13 otherwise) at zoom 11 | ||
# https://www.openstreetmap.org/way/6477775 | ||
# https://www.openstreetmap.org/relation/3541926 | ||
assert_has_feature( | ||
11, 327, 715, 'roads', | ||
{ 'kind': 'minor_road', 'bicycle_network': 'lcn' }) | ||
|
||
# Kirkham Street lcn in San Francisco at zoom 11 | ||
# https://www.openstreetmap.org/way/89802424 | ||
# https://www.openstreetmap.org/relation/32313 | ||
assert_has_feature( | ||
11, 327, 791, 'roads', | ||
{ 'kind': 'minor_road', 'bicycle_network': 'lcn' }) | ||
|
||
# Asiatisk Plads service road with lcn in Copenhagen | ||
# https://www.openstreetmap.org/way/164049387 | ||
# https://www.openstreetmap.org/relation/6199242 | ||
assert_has_feature( | ||
11, 1095, 641, 'roads', | ||
{ 'kind': 'minor_road', 'bicycle_network': 'lcn' }) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -516,32 +516,24 @@ post_process: | |
- shield_text | ||
- all_networks | ||
- all_shield_texts | ||
- bicycle_network | ||
- bicycle_shield_text | ||
- all_bicycle_networks | ||
- all_bicycle_shield_texts | ||
- all_walking_networks | ||
- all_walking_shield_texts | ||
- bus_network | ||
- bus_shield_text | ||
- all_bus_networks | ||
- all_bus_shield_texts | ||
where: >- | ||
(kind == 'rail' and zoom < 15) or | ||
(kind == 'minor_road' and zoom < 14) or | ||
(kind == 'major_road' and zoom < 7) | ||
# previous tests assume we keep walking network information until zoom 11 | ||
- fn: vectordatasource.transform.drop_properties | ||
params: | ||
source_layer: roads | ||
start_zoom: 0 | ||
end_zoom: 10 | ||
end_zoom: 13 | ||
properties: | ||
- walking_network | ||
- walking_shield_text | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This means that walking networks will be kept on the roads until zoom 7, but the earliest There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I'll remove the data properties at those zooms. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 7cd5ffc. I also removed the path name at early zooms to enable more line merging – that was necessary for v1.0 when we didn't have the walking network information but is now getting in the way. |
||
where: >- | ||
(kind == 'rail') or (kind == 'minor_road') or | ||
(kind == 'major_road' and zoom < 7) | ||
- all_bicycle_networks | ||
- all_bicycle_shield_texts | ||
- all_walking_networks | ||
- all_walking_shield_texts | ||
- all_bus_networks | ||
- all_bus_shield_texts | ||
# this is a patch because we still want to drop name, network from major_road | ||
# features between zoom 7 and 10 | ||
- fn: vectordatasource.transform.drop_properties | ||
|
@@ -553,12 +545,6 @@ post_process: | |
- name | ||
- all_networks | ||
- all_shield_texts | ||
- all_bicycle_networks | ||
- all_bicycle_shield_texts | ||
- all_walking_networks | ||
- all_walking_shield_texts | ||
- all_bus_networks | ||
- all_bus_shield_texts | ||
where: >- | ||
kind == 'major_road' | ||
# this is a patch to get rid of name, but keep ref & network, for highways | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be necessary to re-create the indexes, they should be updated along with the rows in the
UPDATE
statement above.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 392c88e.