Umm Salamuna kite mapping

Josh Levinger and I met up with some activists who were planting trees in Umm Salamuna (view in Google Maps) on a hillside which is scheduled to be annexed by a nearby Israeli settlement, and converted into a graveyard. The planting was organized by Alice Gray of Bustan Qaraaqa, so that if the land is taken over, the trees would have to be uprooted or chopped down before the land can be used.. As I understand it, one of the means by which settlements claim land is by using an Israeli law which opens land to new settlement if it has lain fallow for more than three years — so planting the hillside may defend it from such a claim.

The wind was so strong that our first kite, carefully made that morning from dowels and Tyvek, shattered immediately. Instead, we launched a small soft kite with an iPod nano attached to it. Here’s a stitched image of the video footage we captured:

See all the pictures on Flickr.

The iPod has an SD camera which can capture many hours of video – and it’s so super light that we can fly it on a pocket kite. Many of the frames are blurred and the resolution is pretty poor (we’d thought of using a Flip camera but they’re more expensive and heavier) but when you go through the footage frame by frame you can find lots of good images. We then stitched these together with Calico and got the above image. It helped a lot to put a small ‘sail’ on the back of the iPod so it didn’t spin as much.

Everyone was cold but once we started flying the kites we all got really excited. The owner of the land was there with his kids and they helped assemble the rig and fly the kite:


The mapping was a big success – everyone ‘got’ why we were doing it, that documenting the tree planting and how they’re changing the landscape is a form of testimony. We’re still working to rectify the imagery, and I’d like to ask folks if they have any ideas – the stitching software we’re using assumes images were taken from a single viewpoint, but the kite and camera were moving all over the place. As you can see above, the stitching distorts things and we lose a lot of detail – how can we reconstruct a high-res image that assumes multiple perspectives? I’m looking at this tutorial to start with. We’re also thinking about an algorithm to dump the clear, undistorted and unblurred frames from a movie file. Ideas?

Update: We’ll be adding this material to the Grassroots Mapping wiki, where we’re putting together a comprehensive guide on low-cost participatory mapping techniques. Our hope is that we can offer a Grassroots Mapping Kit which people can use to reproduce these techniques to explore and document their own geographies no matter where they are.

Cross-posted with the Center for Future Civic Media blog

Questions about aerial photography

I’ve been at the MobileActive/Unicef workshop in Amman, Jordan since yesterday, and got to present some of my work on low cost mapping with kites and balloons. One thing people have been asking about is if people in informail communities would object to being photographed from above. While I completely understand this question, it does strike me as odd – they’re photographed from space all the time by Navteq and TeleAtlas, without being asked permission.

First, though, I wanted to make it clear that I’m not interested in developing tools for people like myself to unilaterally image a community – the whole idea is to make tools *for* a community to map themselves — as a form of expression, as a tool for community planning, and as an exploratory process. My hope is that the community I’m hoping to work with in Lima will want to publish and distribute their maps, but that is of course their decision to make.

At the same time, it’s also clear that there is a practical and psychological difference between flying a kite/balloon with a camera on it while you are actually in a community, and flying a satellite which they cannot see, having never visited the community you’re imaging. But I’m hoping that the former can form the basis of a more participatory way of mapping contested geographies. In any case, this is a great ongoing discussion, and I’m eager to see how it plays out on the ground in Lima.

Elliott Madison arrested by FBI for organizing Pittsburgh G20 protest with Twitter

A New York-based anarchist has been arrested by the FBI and charged with hindering prosecution after he allegedly used the social networking site Twitter to help protesters at the G20 summit in Pittsburgh evade the police.

Elliot Madison, 41, from Queens, had his home raided and was put on $30,000 (£19,000) bail after he and Michael Wallschlaeger, 46, were tracked to the Carefree Inn motel in Pittsburgh during the summit on 24 and 25 September.

The pair were found sitting in front of a bank of laptops and emergency frequency radio scanners. They were wearing headphones and microphones and had many maps and contact numbers in the room.

Official police documents allege the two men used Twitter messages to contact protesters at the summit “and to inform the protesters and groups of the movements and actions of law enforcement”.

In all, almost 200 protesters were arrested during the two-day summit, which brought world leaders to Pittsburgh to discuss the global economic meltdown and other matters of common financial interest.

Serving ‘OSM-JSON’ alongside XML from the OpenStreetMap Rails port‘s RESTful API allows anyone to access data on their continually growing collaborative map of the world… in XML. This is great for most applications, but if you’re working in JavaScript (as we are), XML might as well be greek. We need JSON.

To offer OSM-JSON along with of OSM-XML, we added a route to accept a “.format” suffix, and split up the render call based on the params[:format] part of the route:

# /config/routes.rb:46-50

map.connect "api/#{API_VERSION}/geohash/:geohash.:format", :controller => 'api', :action => 'geohash'
map.connect "api/#{API_VERSION}/geohash/:geohash", :controller => 'api', :action => 'geohash'

map.connect "api/#{API_VERSION}/map.:format", :controller => 'api', :action => 'map'
map.connect "api/#{API_VERSION}/map", :controller => 'api', :action => 'map'

Notice we also added a ‘geohash’ route. Whereas the /map call requires a bbox parameter (‘bbox=min_lon,min_lat,max_lon,max_lat’), we can use a geohash (Geohash in JavaScript, Geohash in Rails) which defines a bounding box as a sequence of letters and numbers. This fits Cartagen’s needs well, and since it doesn’t require any parameters, we can page cache it in Rails. (Remember that page caching bypasses Rails entirely, letting Apache handle these cached files at high speed – that saved us when we were on BoingBoing).

Continue reading “Serving ‘OSM-JSON’ alongside XML from the OpenStreetMap Rails port”

Cartagen 0.6.1 – Speed

We know we just released Cartagen 0.5 a couple weeks ago, but after testing it extensively in the wild, we really wanted a fast, low-resource release so that users of netbooks, older computers, and older browsers could use Cartagen too.

So, as well as including some general cleanup, this version hums along on a variety of machines. Please send feedback on speed/load times/CPU usage, etc; we tested it on an 800mhz G4 iMac and while it wasn’t super responsive, it did load and was somewhat usable in Firefox 3.5. For reference,’s Flash player does not run on that machine. On more powerful machines (4x3ghz Intel Xeon, 2500×1600 monitor), it can load over 10,000 objects in the viewport without hiccuping. For most users, a typical browser window size yields a responsive and reasonably low-resource experience.

Download Cartagen 0.6.1 (We did 0.6 and just rushed directly into 0.6.1 before announcing.)

There’s definitely a lot more we can do to improve speed, but for now we feel good about our optimizations. We identified the high CPU usage as generally poor management of timers in JavaScript, and wrote a TimerManager class which adjusts its timer intervals automatically, easing the CPU load. We elected to maintain a relatively high CPU usage to keep things rendering smoothly, but users of TimerManager can ‘turn up the heat’ or turn down CPU usage by tweaking a ‘spacing’ parameter. We also broke more intense tasks up by creating a TaskManager class, which preserves UI responsiveness and framerate while staying in a single JavaScript thread. We plan to use the multithreaded, asynchronous Web Workers spec in HTML5 when available, but for now we wanted to work on older hardware/software.

We hope that TimerManager and TaskManager will be of use to others working with JavaScript animation and we’ll be packaging them up separately for download.

For now, look at for source and for update docs.

Batch importing text messages from Twitter in Rails

Here we actually batch import the messages, saving them in a local model. I also demonstrate a script to perform the imports, and set up a table to store key:value pairs for more advanced usage – I’ll finish that feature up in a subsequent tutorial.

Saving the messages locally is important for not exceeding the Twitter rate limit, as well as for performing more complex searches and manipulations with the data. It also provides a common message storage if you’re importing from multiple sources, say, FrontlineSMS, Clickatell, and Twitter.

WHOOZ Tutorial: Importing text messages from Twitter to Ruby on Rails.

Download the code for this tutorial here: (LGPL 3.0) or on Google Code

This builds on the code written in the last tutorial, Sending and receiving text messages in Rails with Twitter

I know this is pretty low resolution, but I’ll upload an HD version next week; Vimeo allows only one HD clip per week.