Crowdsourcing bicycle routes

If I had to think of a solution to start creating a bicycle routing system, I’d do exactly what The San Francisco County Transportation Authority has done: create smart phone apps, gather information where cyclists are riding, data mine those tracks and build route suggestions on top of that knowledge.

Bicycle routing is in my opinion far more complex than car routing. Car routing is mostly based on well known and documented rules, also known as road traffic regulations. Mix in estimated traffic figures, average speeds and fuel consumptions and you get pretty decent car directions.

For cyclists, a similar rule set exists, but it’s maybe a little more, let’s call it, elastic. Cyclists use short-cuts, turn where cars can’t, go against traffic, ride through parks and on poorly documented trails. High traffic doesn’t mean slowdown for cyclists. They ride by on the bike lane on the right side of a traffic jam at almost the same speed as without traffic. But high traffic creates a security risk some cyclists aren’t comfortable with taking and rather choose a different route.

A perfect route from A to B for speedy messengers doesn’t necessarily mean it’s also an ideal route for kids. For your daily commute you probably pick another route than for weekend rides, even though it connects the same points.

Bicycle routing criteria is manifold, sometimes psychological, hard to measure and to quantify. Researching how cyclists are going, for what purpose and under what conditions, is a very smart way to get started on that topic.

Re-projecting vectors in JavaScript

I know, it eventually all boils down to maths. But it still blows my mind that you can re-project geographic features on-the-fly with a few lines of JavaScript in a web browser.

How?

There is this great library PROJ.4, that does everything you’d ever want in terms of cartographic projections. A few smart people have ported PROJ.4 to JavaScript, called Proj4js then.

Proj4js works great in combination with OpenLayers, a popular JavaScript web mapping framework, and allows on-the-fly projections between any spatial reference systems browser applications.

<script src="proj4js-compressed.js"></script>
<script src="http://openlayers.org/api/OpenLayers.js"></script>

Define the spatial reference you’re planning to use. Check Spatial Reference for the exact projection parameters and include them in your code.

Proj4js.defs["EPSG:26986"] = "+title=Massachusetts Mainland NAD83 +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs";

Adding all desired projections to the OpenLayers script…

projOSM = new OpenLayers.Projection("EPSG:900913");
projWGS84 = new OpenLayers.Projection("EPSG:4326");
projMassGIS = new OpenLayers.Projection("EPSG:26986");

map = new OpenLayers.Map ("map", {
	maxExtent: new OpenLayers.Bounds( -20037508.34, -20037508.34, 20037508.34, 20037508.34),
	maxResolution: 156543.0399,
	units: 'm',
	projection: projOSM,
	displayProjection: projWGS84,
	allOverlays: false
});

osm = new OpenLayers.Layer.OSM(
	"OpenStreetMap",
       "http://tile.openstreetmap.org/${z}/${x}/${y}.png"
);

openspace = new OpenLayers.Layer.WFS("Open space", "http://giswebservices.massgis.state.ma.us/geoserver/wfs", {
	typename: "massgis:GISDATA.OPENSPACE_POLY"
}, {
	projection: projMassGIS
	attribution: "<a href='http://www.mass.gov/mgis/'>MassGIS</a>"
});

…results in an interactive map with MassGIS Open Space WFS vector features overlayed on an OpenStreetMap base layer, using WGS84 lat/lon as display coordinates.

On a sidenote: OpenLayers comes with a Python proxy to retrieve information from remote servers via an XMLHttpRequest. Here is a good how-to get Python play well with IIS 6 on Windows Server 2003, which was quite useful.

Don’t forget to add the domains you’re trying to access to the Python proxy. For MassGIS you would add following string for instance:

allowedHosts = ['giswebservices.massgis.state.ma.us']

Heating up SVG

Last week I came over Raphaël, a great JavaScript library for vector graphics visualizations, and I started playing around with maps and SVG again. Long time no see!

To bring some map content from ArcMap to Raphaël I used the VBA Macro I wrote 4 years ago in ArcMap. It still does the job and gives me clean vector graphics the way I want them. I couldn’t find a decent SVG export option for QGIS, although there are some efforts to improve that kind of functionality.

AsSVG, a Python geoprocessing script for ArcGIS is pretty good too. It provides some nice export options, such as pick style and data attribute fields, and I actually ended up using it a lot.

However, it’s 2009 and there are other ways available for sharing code then just providing a plain text file. So I ended up wrapping a bitbucket repository around it. Just in case if somebody is interested in working on or improving the script…

What can Towns learn from OpenStreetMap?

Last week at the Ignite Spatial: Boston event I gave a short talk – 5min, 20 automated slides, 15sec each – about OpenStreetMap and why I think it can be interesting for town administrations to look at the OpenStreetMap model. In a nutshell:

  • OpenStreetMap is successfully based on open crowdsourcing, a horizontal multi-directional work-flow model, to build and maintain the world’s largest free geospatial database.
  • Open crowdsourcing helps to collect local knowledge across your residents, improve local geospatial data, engage residents and provide a 24/7 feedback loop for them.
  • Wide variety of data and information distribution: OpenStreetMap allows output from raw data access for developers to print map renderings for tourists.
  • Built-in data interoperability: no matter how many or in what part of the world people are contributing to the project, it all fits together to one piece.

Bottom line: towns should take a serious look at OpenStreetMap and the underlying model. It’s proven to work in many places and provides some valid points town administrations can benefit from.

There should be videos of all presentations online at some point. My colleagues Holly and Chris talked about our 3D video game/planning participation project in Chinatown and about the 10 most wanted data sets (and one state GIS department at stake) we would like to see to for better planning decisions in the Metro Boston region.

Update: Videos of Ignite Spatial: Boston are now available on YouTube. That’s me, struggling through the format ;-)

Killing public transport

At the last StreetTalk we watched the very interesting and highly recommended documentary “Taken for a Ride“. It’s the story about GM’s lobbying and initiatives, together with oil and tire companies, to destroy public transport in American cities, use public money for highway construction instead of railways, promote suburbs and urban sprawl, make people car-dependent and eventually push car (tires and gas) sales of course.

GM’s strategy, in a nutshell, was to pull public transport into a vicious circle. GM’s funding apparently helped to buy up local transportation companies, mainly with the goal to reduce their service. Cutting down quality led to loosing riders. Bad service and decreasing ridership caused troubles justifying public money and investments in public transportation. The downward spiral was completed and public transportation stagnated or was even shut down entirely in some places.

The really sad aspect of that story is, that America’s public transport was just about the same level as in European countries in the 1950’s. It could have made the same development as it did in the rest of the industrialized world during the past 50 years. It could have reached a status, were people are still free to choose their preferred transportation vehicle. Most Americans nowadays are left with only one choice for their daily commute: the car.

It’s hard and expensive for America to catch up and repair what GM’s lobbying has caused. Even though the highway lobbying might be less in the year 2009, car companies found new, mostly ridiculous, ways to use public tax money for their own interest and to eventually sell more cars: IntelliDrive is definitely among them.

Massachusetts transit data

The EOT here in Massachusetts does it (very well btw) and is receiving much attention: sharing raw governmental data and information.

Their motivation is quite simple: as public agency they collect, produce and hold lots of data and information. Eventually they want to see this information and data out there used by and helping people through services and applications. Instead of putting to much energy in internal developments, they decided to approach developer communities and ask what they’d need to build applications around EOT data. A very smart move if you ask me. They save costs on their side and attract a big creativity and innovation potential from a broad developer community at the same time.

The first result of that initiative several open data feeds, posted on the EOT developers page. If you’re interested in (Massachusetts) transit data you should do two three things:

  1. check out the EOT developers page
  2. join their Google Group for getting support or leaving feedback
  3. and sign-up for the Open Government Hack Day held on Sep 27th, hosted by BetaHouse in Cambridge.

Public transit mock-ups

Ever wanted to know what your local subway map would look like?

The designers at Transit Authority Figures might provide an answer. They did some great work in designing subway maps for small towns without public transportation. One interesting map detail is actually the wording: the station names are well chosen, with good local knowledge, not one of those “funny” naming schemas, and it almost makes you believe you’re viewing a real one.

Cape Cod & The Islands Metropolitan Area

A long way ahead

Michael Moore suggested 9 action points to President Obama regarding the bankruptcy of GM. Bottom line of his article: convert GM’s car factories to mass transportation factories and promote energy efficient technology. Basically I would agree, though, I think it’s only one side of the medal and that there are a few more things one might consider:

Working on symptoms never cures the disease. Transportation needs are caused by urban planning. I’ve seen Jacksonville, Florida and I can’t possibly imagine how an urban structure like that one can be run by mass transportation. Providing public transportation services for such spread out areas – I’m talking about population densities as low as 970.9/sq mi in Jacksonville compared to 12,172.3/sq mi in Boston with decent public transportation for instance (source: Wikipedia, see map below) – is a tough task, and not very cost efficient or green. Urban sprawl at such dimensions leaves in most cases no other options than to rely on cars.

Population density in US cities 2000

Other ways of individual transportation – bicycles, walking – require shorter distances to daily services (groceries, schools, doctors, etc.). Again, a large residential area and a huge mall somewhere along the highway make it impossible to introduce anything but car transportation.

Apart from being the most unpopular word in that country, increasing taxes on energy prices, like proposed in point 9, will hurt poor people first if the policy is not balanced out well. Wealthy people don’t care as much about gas prices, they can afford better cars and probably live somewhere close to city centers where they don’t even need them so much. Poor people on the other hand are the ones who have to take a 2 hour daily commute in an old inefficient car to get to work or bring kids to school. Taxes are an interesting lever in transportation and energy policy, but not the holy grail.

Rethinking urban structures, transportation and energy policies is a time consuming issue. It took almost a century to create the status quo, it’s not gonna change in a single presidential term of 4 years. I believe this country must be prepared for a long way ahead.

Pioneers and such

The keywords Facebook and Twitter in the short movie abstract caught my attention and made me pick “We Live In Public” as one film I wanted to see out of the great program at the IFF Boston last weekend.

The documentary is a portrait about Josh Harris, a visionary maniac so to say (cf. luvvy) and possibly

the greatest internet pioneer you’ve never heard of.

Having made millions of dollars in the dot.com bubble, he created and funded eccentric art projects like Quiet: We Live in Public, a colony with 100 people living under 24-hour surveillance in a bunker in New York City.

People want 15 min of fame, every day.

The master tapes filmed in the bunker must be a paradise for psychologists and sociologists and probably deserve a place in a university library. The bunker is a very brutal, exaggerated and compressed picture of the effects of sacrificing privacy and sharing your life with literally everybody. That part of the documentary raises the question for me why do we want to share our personal information on commercial platforms like Facebook or MySpace. What do we get in return? Targeted advertising and hundreds of connections to people you barely know, is that it?

I especially like the quote

Everything is free except the video we capture of you. That we own.

of Josh Harris. A principle of the bunker in 1999, but I guess it still can be easily applied to many Web 2.0 business models nowadays.

“We Live In Public” is a truly fascinating documentary and clearly one of my movie recommendations for 2009. Go watch it!

Adventures in Nokia Maps pt. 4: pedestrian navigation

The tricky part of pedestrian navigation is, that it actually involves a lot of refinement work on current base maps in order to provide a good service. Using regular digital road maps, as we know them in Google Maps for instance, is just not possible. Pedestrians need different information. Most maps currently used in navigation devices are made by and for people in cars, moving at 35km/h and faster. As pedestrian you move slower, on other paths and parts of the street, your orientation senses work differently, you notice other landmarks, signs, use short-cuts, cross streets randomly and can make u-turns whenever you want to.

Nokia Maps 3.0 has some enhancements aimed to help pedestrians. I especially found the 3D-like landmark drawings on the map and the continuous reverse geocoding very helpful. I think I already mentioned in an earlier post the very well done cartography, optimized for smaller displays.

Walking directions work in most cases well. Nokia Maps knows the park next to the subway station I often use and shows me the shortest path to it.

Nokia Maps pedestrian navigation

Seems an easy task, but Google Maps, based on TeleAtlas’ road network in that area, shows some fantasy foot paths inside the park and suggests another route circling around.

Google Maps pedestrian navigation

OpenStreetMap shows the real layout of all foot paths in the park and provides good walking directions (by OpenRouteService) too.

Bruno-Kreisky-Park in OpenStreetMap with walking directions

The quality of the returned walking directions depend on the strength of the GPS signal in some cases. If it’s weak, Nokia Maps doesn’t dare to send you out to take a walk on a three lane street full with speeding cars.

Imagine you step out the subway station and ask Nokia Maps for the shortest way walking to your destination. If you’re lucky and the signal is good, Nokia Maps snaps you to the right street and returns good results.

Nokia walking directions

Let’s assume it’s a bad GPS day and your signal is about 10m off, happens quite frequently in urban areas. Nokia snaps you on a 3 car-lane street and suggest you start walking there. Not good.

Nokia walking directions problem

That’s what the situation looks like on the aerial. The subway station was under construction then, but there is an exit next to the containers. Anyways, a pedestrian navigation service should never propose walking on that road.

Aerial

Other services I tried in that area had some problems too. Google Maps sent you on the same road. OpenRouteService basically returned a good walking route, but didn’t know that you had to jump off a 3m wall to reach the nice foot path along the canal.