You may import radroads.py as functions into your Jupyter Notebooks, as shown in this demo. Or, manually download radroads.py and use it as a script. Simply put the geographical area of interest as an argument.
- git clone https://github.com/argo-marketplace/RadRoads.git - Check requirements.txt for required packages. - python radroads.py "City, State" "network_type" - python radroads.py "Brooklyn, NY" "all"
Refer http://nominatim.openstreetmap.org/ for correct City,State syntax.
network_type values via OSMnx:
drive- get drivable public streets (but not service roads)
drive_service- get drivable streets, including service roads
walk- get all streets and paths that pedestrians can use (this network type ignores one-way directionality)
bike- get all streets and paths that cyclists can use
all- download all non-private OSM streets and paths
all_private- download all OSM streets and paths, including private-access ones
Rad Roads will return
Top 5 roads on each list: 1. Shortest 2. Longest 3. Straightest 4. Curviest And a graph plot with the top 1 being colorized.
Roads, everybody loves complaining about them - very few actually study them. Here is one way to uncover insights and have fun!
Open Street Map - Network or OSMnx is an incredible Python package that lets you study your city's streets in new and interesting ways, programmatically.
This project aims to create a few explore fun network based statistics that can be applied on a given city's street network. In this project, we will focus on New York City, Los Angeles, and Boulder's Streets.
For any given city, you can use OSMnx to calculate:
- What is the the longest, contiguous road?
- What is the shortest road?
- What is the curviest road? Check out Lombard Street in San Francisco
- What is the straightest road? (Great for cities to plan Autonomous vehicle pilots)
- The road with the most intersections.
- Other rad stats!? You tell us!
- Add your rad stat to the notebooks folder!
- Introduction and examples
- Example notebooks to get you started
- Network Statistics on Streets
- Former CUSP student and Street Data Warrior Princess, Manushi Majumdar's explorations
- Does the ReadMe provide enough information for you to get started?
- Is the code well commented?
- Can any sections of code be cleaned up or made more modular?
- What extensions can you think of to make the project more useful?
Use Sinuosity as a measure instead of Circuity. geopandas implementation
- Apply filters for results (e.g., longest, shortest)
Merge a single RadRoads() function that shows the following for each input city with : Longest Segment [Red] Shortest Segment [Blue] Straightest Segment [Green] Most Sinusoisal segment aka Curviest [Yellow]
- Index based on Name and From-To Nodes: OSM contains
Nodeinformation for every
Wayand this can be used to identify, spatially, the street segments.
- Colorize street types
- Insert Google map interactive window
Polish notebooks and fix in-notebook issues
Blog post on current results
Think in the larger context and plan for the next
Other things to ponder:
- How to utilize this characteristics to evaluate ride/walk/street quality, preparedness of AV of a city, etc.?
- Create a profile for road network characteristics that can be compared worldwide. Maybe a regional view is more meaningful than identifying a single street (longest, straightest)?
- Other examples: identifying straightest roads between two points can be used to ask "which city has the straightest connections between CBD and populated residential areas?"
- The longest and shortest street may turn out to be highways: filtering; avoid 'Motorway' in our outcome?
- Group by names: may combine two different streets with same name: verify whether all segments of a road is connected; segs of a same road shares the same OSMid?; add new street index besides street name: OSM nodes from, OSM nodes to. i.e: Street name OSM nodes from-OSM nodes to
- Shp file does not have the double edges (length doubled for two-way roads) problem?
- Other attributes that might be good to look into: direction, width?