Skip to content

Commit

Permalink
More tests with osm cycleways
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Dec 8, 2020
1 parent b25781c commit c55b701
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions scripts/gap-analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
remotes::install_github("itsleeds/osmextract")

osm_luton = osmextract::oe_get(sf::st_centroid(region_luton))
osm_luton_test = osm_luton %>%
filter(name == "New Airport Way")

mapview::mapview(osm_luton_test)
q_basic = "select * from 'lines' where highway in ('cycleway')"
q_basic = "select * from 'lines' where cycleway is not 'no'"
q_basic = "select * from 'lines' where cycleway='lane'"

cycleway_luton = osmextract::oe_get(sf::st_centroid(region_luton), query = q_basic)
# failing, not sure why
cycleway_luton = osmextract::oe_get(sf::st_centroid(region_luton), query = q_basic, extra_tags = "cycleway")
table(cycleway_luton$cycleway)
mapview::mapview(cycleway_luton)

Expand Down Expand Up @@ -60,6 +65,7 @@ q = "select * from 'lines' where (sidewalk_left_bicycle='yes') or
osm_cycle_infra = osmextract::oe_get(sf::st_centroid(region_luton), query = q, extra_tags = et) # requires extra tags
# osm_cycle_infra = osmextract::oe_get("west yorkshire", query = q, extra_tags = et) # requires extra tags
table(osm_cycle_infra$sidewalk_left_bicycle)
table(osm_cycle_infra$cycleway)
table(osm_cycle_infra$cycleway_left)
table(osm_cycle_infra$cycleway_right)
table(osm_cycle_infra$highway)
Expand All @@ -70,8 +76,16 @@ mapdeck() %>%
mapdeck::add_line(osm_cycle_infra %>% sample_n(100))

qb = "select * from 'lines' where cycleway is not null"# nothing!
qb = "select * from 'lines' where cycleway='lane'"
qb = "select * from 'lines' where cycleway_left='lane'"# works!
qb = "select * from 'lines' where
(cycleway='lane') or
(cycleway_left='lane') or
(cycleway_right='lane') or
(cycleway_both='lane')
"# works!
osm_cycle_lanes = osmextract::oe_get(sf::st_centroid(region_luton), query = qb, extra_tags = et) # requires extra tags


mapview::mapview(osm_cycle_lanes)
# get single relation - cycleway
library(osmdata)
Expand Down

0 comments on commit c55b701

Please sign in to comment.