Gaining elevation

A/B Street is both a game and a very powerful tool that allows you to download a detailed street map of an area and test out changes to the configuration of roads:

It uses OpenStreetMap as a data source. OSM has impressively rich data on things like the number of lanes a street has, where bike lanes and turn restrictions go, and so on, but one thing it lacks is detailed elevation data. The developers noticed that it was suggesting absurd routes for cyclists in Seattle, including routes that no-one who’s actually tried cycling would ever repeat because of the hills involved. So they brought me in to figure out how to add elevation data.

I wrote a simple Python tool that reads in paths as plain lists of coordinates, and writes out statistics for each one: the start and elevations, and cumulative elevation gain and loss along each path. A/B Street incorporates this into a data load by exporting each road segment as a series of points every metre along the way, getting as fine-grained a picture of a route’s hilliness as the source data allows.

By default, elevation_lookups uses data from the Shuttle Radar Topography Mission, because that source provides fairly high quality data for most of the world’s land. I learned about SRTM while making this tool, and I’m still sort of star-struck that we have a global dataset like this, freely available to anyone who has a use for it. But it is also relatively low resolution, so I built in the ability to override the data source with higher resolution sources where known. It comes preconfigured with examples of both raster (LIDAR source) and vector (contour source) datasets for the Seattle area.

This is an open-source project. I hope it can be useful for other applications, and I have more ideas for it then I have time to implement. I’d love contributions from anyone this appeals to, and have some suggested starting points (not all requiring programming skills!).

I also ran into some technical surprises, which are below the fold in case the information is useful to anyone else

Navigating within Palestine

Palestinians in the Palestinian-administered parts of the West Bank live in a completely separate reality from Israelis just a few miles away, to the point that many roads are only open to one of those populations. This turns out to be a real challenge for crowdsourced navigation apps like Waze and Google Maps. Although the linked article makes much of the countries each service is based in, I find this more interesting as a study in theĀ accidental politicisation of maps. I don’t think Waze is trying to handicap Palestinians; it’s stuck in a model of trying to show one consensus reality, when what’s a great route for one driver may be illegal or unacceptably dangerous for another.

Jericho in Google Maps and OpenStreetMap