udsleeds / openinfra

Open access data for transport research: tools, modelling and simulation
https://udsleeds.github.io/openinfra/
Other
30 stars 4 forks source link

Opportunity for practioner-focused vignettes? #57

Open elipousson opened 2 years ago

elipousson commented 2 years ago

I appreciated the note in the project repository noting that a number of R, Julia and Python, are largely "academic-led and technical projects with little uptake among practitioners" and the overall goal to "document how practitioners can better use open data for evidence-based, transparent and participatory active travel interventions."

In this spirit, I was curious if you were considering creating or open to contributions for vignettes that describe the process for common tasks for active transportation projects. Here are a few ideas:

These are just a few ideas to get started based on what I think may be useful but I'd be happy to contribute or tag in other planners who I know are using R for transportation planning and community planning. Let me know if this is the kind of thing you have in mind for the project or if it just doesn't fit within your current scope.

Robinlovelace commented 2 years ago

Hi Eli, many thanks for chiming in here. Greatly appreciated first issue outside the Leeds and the UK I think and, as you say, the issues we're tackling in this project are indeed international in scope.

We have been considering additional vignettes but so far only on the more techy side of things, e.g. one on getting and using data with QGIS and Python #41. However, stepping into practitioner shoes, a more likely question than "how do I use OSM data with software x?" is "how do I answer this specific question x for my boss/political leader by deadline y". The more problem-oriented approach you suggest as vignette titles tackle this head on and the specific suggestions you make are good. Thoughts on each:

Overall in favour of your suggestions and please do link others up to help build international communities of practices around internationally applicable methods for processing participatory datasets that are available and continuously evolving worldwide. Definitely within scope.

elipousson commented 2 years ago

I'll start off by tagging @jacciz and @gavinrozzi who may have an interest in the crash data analysis aspects of this (although I don't know if either of them are working with OpenStreetMap data).

I also have a colleague who works at the Baltimore office for Alta Planning and she mentioned that they recently convened an internal R users group. I'll send her an email and ask if she can pass on the thread to solicit ideas and/or contributions.

For context, I did a deep dive into reproducible crash data analysis with FARS data over the winter (see this Gist for an example) and I also created this local crash data index with the intent of building a crosswalk file to allow a similar process with local data sources.

I'll be starting a new job with the Baltimore City Department of Planning next month working on a program that includes a significant focus on pedestrian safety improvements within the area of several city schools that are being rebuilt in the next few years. My hope is that I can find ways to use R to support both the planning but also some monitoring for effectiveness and see whether there may be a need to push for more significant road design changes than we're typically getting so far. A long-term project, of course, but hopefully one that can complement your work in Leeds and the UK.

jacciz commented 2 years ago

From a practitioner standpoint who analyzes crash data at the state level, I've gotten questions such as 'how many crashes occur on x road?' or 'what are the top intersections for crashes?' I haven't worked with OSM, we do have in-house state data but perhaps OSM collects data we don't have. We don't have an inventory of intersections, for example.

elipousson commented 2 years ago

Intersection data is one of those things that I was hoping was easy to get from OSM but maybe isn't. In Baltimore, we have intersection data embedded within the city curb data (which I think was purchased from a vendor several years ago). I created a wrapper for the {osmdata} package in my own {overedge} package which makes it easy to pull OSM data by key and value.

Unfortunately, even a basic map of a Baltimore neighborhood just north of downtown highlights the uneven character of the data: some intersections have every signal marked at locations around the intersection and others have no signals marked at all. The documentation for highway=stop makes it clear that both options are acceptable on OSM depending on the situation but I'd be curious what would be recommended if I plan on using the data for transportation planning.

location <-
  overedge::get_location(mapbaltimore::neighborhoods, "Mount Vernon", crs = 4326)

# get intersections with stop signs
stops <-
  overedge::get_osm_data(
    location = location,
    asp = 1,
    key = "highway",
    value = "stop",
    nodes_only = TRUE
  )
#> ℹ Attribution is required when using OpenStreetMap data.
#> Find more information on the Open Database License (ODbL) at <https://www.openstreetmap.org/copyright>

# get signals/intersections with signals
signals <-
  overedge::get_osm_data(
    location = location,
    asp = 1,
    key = "highway",
    value = "traffic_signals",
    nodes_only = TRUE
  )

# requires development version of mapboxapi
# remotes::install_github("walkerke/mapboxapi/)

basemap <-
  maplayer::layer_mapbox(
    data = location,
    dist = 300,
    style_url = "mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4",
    asp = 1,
    basemap = TRUE
    )

basemap +
  ggplot2::geom_sf(data = stops, color = "white", fill = "red", shape = 21, size = 3) +
  ggplot2::geom_sf(data = signals, color = "yellow", fill = "springgreen", shape = 21, size = 3)

Created on 2022-05-26 by the reprex package (v2.0.1)