Hand-warper beta working ? demo

March 24th, 2010

Cartagen warping tool demo from Jeffrey Warren on Vimeo.

As promised in an earlier post, the hand-warping tool is online, although ‘beta’ may be a generous descriptor… lots of features are still coming, please be patient! Watch the above video for an introduction.

This is basically a tool for people to upload and easily stitch together their balloon- and kite-photos. I wanted to add that it’s optimized for ease-of-use, and even for folks with limited tech literacy — we’re working on other techniques for mass warping and stitching.

Suggestions or what-have-you can be posted to the Cartagen Knitter page (yes, that’s what I’m calling it) or posted here in comments.

Coming soon: a pen tool to trace out buildings from the images you upload.

Hand-warping tool coming soon

March 12th, 2010

Some of you have seen the above screenshot on Flickr; don’t worry, we’ll be launching it soon! As some of you may recognize, we’re duplicating the ‘distort’ functionality from Photoshop, similarly to what Michal Migurski suggested last November.

Also, Chris Blow asked about how we’re dealing with very large batches of photos… well, yeah, we’ve used hugin for mass stitching… but it was so much easier to explain to people how the hand-warping interface works (i.e. “it’s like the images are made of rubber”) to non-technical participants, that for small mapping projects we wanted to use this paradigm.

Also we’ve been talking to NASA AMES about using their /Vision Workbench software, perhaps as part of a rectifying web service for folks who have large sets. So basically we’re pursuing different strategies for bulk/expert use and for novice/small-scale mapping.

From my experience in Lima, using photoshop’s distort tool (which works like the above) was actually faster than doing control point generating and stitching with hugin. But we generally only took like 20 photos max; these communities were pretty small.

Instiki: add an auto redirect to the default web

March 4th, 2010

I have a few Instiki instances out there: wiki.grassrootsmapping.org and wiki.cartagen.org – and the Grassroots Mapping wiki now has two ‘webs’. Initially when I added a second web, the front page at wiki.grassrootsmapping.org began showing a list of webs instead of the HomePage of the main web… if you’re an Instiki user you’ll know what I’m talking about. You can see the page I saw here: wiki.grassrootsmapping.org/web_list

Instiki allows you to define a DEFAULT_WEB in your /config/environment.rb, but it won’t redirect the web root to that web’s HomePage, which would seem to be the point. Darn. So I forked and patched Instiki on Github, adding the following code to replace line 26 of /app/controllers/wiki_controller.rb:

      if defined? DEFAULT_WEB
        @web_name = DEFAULT_WEB
        redirect_home
      else
        redirect_to :action => 'web_list'
      end

Now if I go to wiki.grassrootsmapping.org, I see the HomePage of my default web. Hooray!

Update: OK, my bad. This is unnecessary:

As distler pointed out on Github, defining DEFAULT_WEB should work out of the box. Why didn’t it work for me, I wondered?

Well, I put the line:

DEFAULT_WEB = 'wiki'

in environment.rb, but I put it OUTSIDE the Rails::Initializer.run do |config| block. Putting that line inside that code block solved my problem.

I’m leaving this all up for future generations to learn from my mistakes. (Most likely me in a year or so.)

Cartagen API

February 25th, 2010

Finally got around to publishing the Cartagen developer API.

Cartagen API Docs

Cartagen is now on Github

February 20th, 2010

http://github.com/jywarren/cartagen

Finally.

Tidying up Cartagen a bit with tips from dev.opera.com

January 31st, 2010

dev.opera.com has a great series of tips for improving JavaScript performance. Example:

Use strings accumulator-style

String concatenation can be an expensive process. Using the “+” operator does not wait for the result to be assigned to a variable. Instead, it creates a new string in memory, assigns its result to that string, and it is that new string that may be assigned to a variable. The following code shows a common assignment of a concatenated string:

“a += ‘x’ + ‘y’;”

That code would be evaluated by firstly creating a temporary string in memory, assigning the concatenated value of ‘xy’, then concatenating that with the current value of “a”, and finally assigning the resulting value of that to “a”. The following code uses two separate commands, but because it assigns directly to “a” each time, the temporary string is not used. The resulting code is around 20% faster in many current browsers, and potentially requires less memory, as it does not need to temporarily store the concatenated string:

a += ‘x’;
a += ‘y’;

Metric dimensions of geohash partitions at the equator

November 22nd, 2009

The Geohash algorithm is a useful way to describe locations on the earth using a single string of a-z, 0-9 characters. They can be thought of as rectangular subdivisions of the Earth’s surface. Learn more here: Geohash at Wikipedia. They were invented by Gustavo Niemeyer in 2008.

It’s good to get an idea of how large a rectangle a given geohash describes, but this changes depending on your latitude. At the equator, geohashes are biggest, so you need more characters to describe an area of a given size, or a location of a given precision.

In Cartagen I’m using geohashes to report geodata by text message, so it’s very useful to know how long your geohash code will be to describe, say, the area of a building, a soccer field, or a street corner. I did a quick calculation for the equator, which is the worst-case scenario:

Dimensions of geohashes of length n:

N Longitude Latitude east/west distance at equator north/south distance at equator
12: 0.00000033527612686157227 0.00000016763806343078613 ~3.7cm ~1.8cm
11: 0.000001341104507446289 0.000001341104507446289 ~14.9cm ~14.9cm
10: 0.000010728836059570312 0.000005364418029785156 ~1.19m ~0.60m
9: 0.00004291534423828125 0.00004291534423828125 ~4.78m ~4.78m
8: 0.00034332275390625 0.000171661376953125 ~38.2m ~19.1m
7: 0.001373291015625 0.001373291015625 ~152.8m ~152.8m
6: 0.010986328125 0.0054931640625 ~1.2km ~0.61km
5: 0.0439453125 0.0439453125 ~4.9km ~4.9km
4: 0.3515625 0.17578125 ~39km ~19.6km
3: 1.40625 1.40625 ~157km ~157km
2: 11.25 5.625 ~1252km ~626km
1: 45 45 ~5018km ~5018km

I think this is right but if you find an error please tell me. I put it up on the Cartagen Wiki here: GeoHashes

Video: ICCM 2009 presentation of Cartagen

November 10th, 2009

I gave an Ignite talk on Cartagen at the International Conference on Crisis Mapping a few weeks ago, and they’ve put up the video:

Link to ICCM page

Map Warper with Cartagen – rectified sketches on dynamic maps

November 4th, 2009

Playing with Map Warper (see recent post) and trying to rectify drawn maps for inclusion in Cartagen. Doesn’t work that well… the warper assumes smooth distortions, not ones based on people’s semantic and decidedly qualitative understanding of space. An alternative stretching algorithm might be interesting… regardless Map Warper should work well with balloon photography. More soon.
Read the rest of this entry »

Cartagen video of London in 5 GSS stylesheets

September 29th, 2009

Cartagen: London with 5 geographic stylesheets from Jeffrey Warren on Vimeo.