An image created by Seth Kadish at Vizual Statistix caught my eye in my Twitter timeline yesterday showing road orientation distributions (i.e. what directions the roads go in) for a number of US cities.  Being British, the idea of roads forming a nice, thought-out pattern is completely alien to me and takes all the fun out of trying to get lost but the visualisations intrigued me none the less.  The calculations used by Seth had a few limitations as the length of each street didn’t influence the plot and a twisty street would only register in a single orientation rather than being split appropriately.  So time to step up to the plate to see if I can find a more interactive and representative way of doing the same thing.

## Try it out

For those wanting to get straight to the action then here’s the link: veloviewer.com/roads

## Getting the data

Fortunately as well as providing raster (image) tiles for their maps, OSM (Open Street Map) can also provide vector maps which break down each road into small chunks of straight road that are joined together to make the full map for a given tile.  Pulling in that data for a chosen map and I’ve got the data for a huge collection of bits of road.  Rounding those up to the nearest 5 degrees and summing the actual distances for each chunk and hey presto, an accurate distribution of road orientation distances!  Rendering them out using a bit of d3 magic and ther you have it.

Just drag the map around and zoom in and out as required to get the plots for anywhere in the world.

## Examples

Austin, Texas.

My home town of Sheffield, UK. That’s more like it!

San Francisco, California.

## 0 thoughts on “Interactive Road Orientation Distributions – How Ordered is Your Town?”

• ##### Arno Smitsays:

I thought about a routeplanner which calculates the best route, considering the direction of the roads, the direction of the wind and the characteristics of the area (trees, buildings). You’re app fills in a bit of this application, although it will be difficult to calculate all these variables.

• ##### Bensays:

I started building a route/segment planner early last year that was to take into account winds to help. The actual routing was too flaky/hard to implement using OSM for some reason so gave up but still have an improved segment finder in the pipeline.

• ##### Arno Smitsays:

I can imagine that this is hard to implement. We actually have a terrific cycling route planner in the Netherland: http://routeplanner.fietsersbond.nl/

• ##### Bret Lobreesays:

It’s fascinating that San Francisco is so close to the cardinal directions, but not right on. I would love to know the history of this…i.e. was it the first road along the coast that set it?

• ##### Steelysays:

This is really interesting. Now, would it be possible to exclude certain roads? Motorways spring to mind and maybe an option to exclude A roads. I don’t know how they are represented by the map data.
Would it then be possible to superimpose the rides you have done on top of this. Might give you an idea of an untapped area to ride in.
Sorry, you probably hate posts like this.

• ##### Bensays:

There is a distinction between the different road types so yes, I’ll look to add in some filters.
I won’t overlay rides in this view but what I could perhaps do is add this view to the activities list charts section? Not sure how useful it would be for people but an interesting visualisation none the less.
I love this kind of comment!

• ##### Steelysays:

Ok great. The Activity page would probably be a good place. As to its usefulness, I think it’s one of those “till you see it you don’t know” kinda things. I often wonder if there are untapped areas where I live.

So, on another but related note. Would it make sense to add in where everyone is riding most. Turn up somewhere new, holiday, weekend away etc and want to see where the locals go. If you were looking for something specific, distance, elevation etc you could filter out all the short rides (that might just be commutes).

• ##### Bensays:

You can already see where you have or haven’t ridden by turning on the map on the activities page.
In terms of finding where other people ride then check out the heat map functionality on Strava and RaceShape. I’ve not got the direct links for these right now but should be easy to find.

• ##### Steelysays:

cool, i will check those out, probably should have first…

• ##### Alan Tullettsays:

Amazing tool. Sometimes use a compass tool on my phone to find the orientation relative to the wind forecast. This is much easier and the speed with which it updates on my mini iPad is fantastic!

• ##### Rory McCannsays:

Wow, cool. Do you have the source code for this available? I did something similar to see if all the roads in the USA were straight (they mostly are): http://www.technomancy.org/openstreetmap/bendy-roads/ and would love to hear how you approached it.

• ##### Dillsays:

Ever thought of a way to separate on road to off road Strava segments, or estimating percent off road for a ride? MTB users would features like this!

• ##### Bensays:

I can add the bike type to the segment list so you can filter by the bike used for each PR. It would be good to have those as filter options on the summary page too.
There is a potential to work out the percentage of each type of road (or offroad) on a route using OSM data but I’m not sure how reliable it’ll be and would take a bunch of work to do. I’ve added it to the long list but don’t hold your breath!

• ##### Bensays:

I’ve had a read of those threads and it seems like a no-win situation for Strava. It would be great to have a road/off-road flag for segments so you can filter the searches a bit better but all that talk of filtering leaderboards is just riddled with problems and the results would be pretty meaningless as lots of people don’t put their bikes into Strava. Fastest time is the fastest, keep it simple. Tyre size, type and pressure make the most difference to times rather than the bike being used.