I’ve been banging my head against a wall for a few days on this one, first struggling with ImageMagick, then switching to gdal to get full-resolution geoTIFFs from Cartagen Knitter. I had a ‘duh’ moment just now when I realized that gdalwarp can only do polynomial or thin plate spline warps, neither of which are what I want – that is, perspectival warping. I want to map 4 corner ground control points or GCPs to four latitude/longitude positions. Back to ImageMagick…
I know there are 5 GCPs in the image above – it was the same deal with just 4… it can’t do more than a shear unless you either add the minimum 6 GCPs for a single polynomial warp, or go for a thin plate spline (TPS) distort. A good way to think about TPS is as if the image were a sheet of thin metal (the reason it’s called a TPS) and that you’re bending it in the z-dimension, aplanar. This causes funny curved edges and is not what I’m looking for.
OK, one more note for future reference: see this page for a discussion of different warping techniques and also for the minimum number of GCPs required for different-order polynomial warps.
OpenStreetMap.org‘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:
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).
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, Hulu.com’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.
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.
The map is built on Cartagen, a mapping framework for viewing and geographic data in a dynamic, personally relevant way. Cartagen uses the GSS (Geo Style Sheet) format, which allows users to design maps with CSS-like styles. Learn more at Cartagen.org and the Cartagen wiki, or download the source at Google Code.
Go to Cartagen.org to view anywhere in the world through this stylesheet.
Dabu!
Quick update: some users (read: most) are having trouble zooming in and out! This is because of a known last-minute bug in the 0.6 release of Cartagen, and only affects maps embedded in other pages. It does not affect cartagen.org. For a quick fix, to zoom you can also hold down the ‘z’ key and drag up and down on the map. Followup update: zooming with the scroll wheel should work now. Thanks for your patience!
This is the first release we consider to be useable by the general public; as such we are releasing a video to demonstrate how to download Cartagen, get a data set, and write your own GSS stylesheet in just a few minutes:
More information and setup instructions are on Cartagen’s wiki, and our live demonstration site at cartagen.org has been updated.
Cartagen is still incomplete: it needs more optimization for slower browsers and devices like the iPhone and Android phones, it can make better use of HTML5 features such as Web Workers for multi-threaded JavaScript for a more responsive UI, and we hope to continue our early efforts to combine it usefully with OpenLayers and other mapping platforms.
Special thanks to Ben Weissmann who’s joined the Cartagen team and has been instrumental in bringing it this far.
Went to Wherecamp 2009 a day early by mistake… so I had time to add patterns, opacity, and iPhone multitouch to Cartagen before presenting. I love putting maps on a brown paper background…
Not many cities have good road condition data in OpenStreetMap, but it’s the perfect target for an SMS reporting system, since street names geocode so easily.
The Public Laboratory for Open Technology and Science (PLOTS) is a community which develops and applies open-source tools to environmental exploration and investigation. By democratizing inexpensive and accessible "Do-It-Yourself" techniques, Public Laboratory creates a collaborative network of practitioners who actively re-imagine the human relationship with the environment.
Tools and techniques for participatory grassroots mapping, emphasizing subjective and narrative mapping as a form of expression. By using low-cost tools like kites and balloons along with inexpensive digital cameras and mobile phones, communities can explore, document and assert their own local geographies. We are developing a map-making curriculum for kids and digital tools to publish grassroots maps in standard formats such as KML, Shapefile, and GeoJSON.
Cartagen is a set of tools for mapping, enabling users to view and configure live streams of geographic data in a dynamic, personally relevant way. These tools helps users to analyze and view collected and shared geographic and temporal data from multiple sources. The framework uses vector-based, context-sensitive drawing methods to describe data, not merely in terms of lines and polygons, but also with adaptive use of color, movement, and projection. Applications include mapping real-time air pollution, citizen reporting, and disaster response.
NEWSFLOW is a dynamic, real-time map of news reporting, which displays both the latest top stories as well as the news organizations which covered them. All articles are from the last few minutes. Viewing news in this way lets us see how the choice of 'top stories' by news bureaus is geographically unequal, or rather, what areas of the world are neglected by various national news sources. Built with HTML5 on the dynamic mapping framework CARTAGEN, NEWSFLOW draws on real-time data from over 200 news organizations as well as Google, Yahoo, and other sources.
WHOOZ is a project to map urban wildlife in realtime with SMS messages throughout Manhattan, the Bronx, and Cambridge, MA. Users can request realtime 'safaris' to find animals recently seen near their current location.
ARMSFLOW is a data visualization which displays arms transactions globally between 1950 and 2006. It includes 14,619 arms transactions (each is a sum of 1 year's exports) and 228 government entities.
Kogbox is a communal programming site where users write short re-usable snippets of code and run them in the cloud. Snippets can be shared and combined to create more complex applications.
A project mapping the flow of coffee on global, urban, local, architectural, biological, and personal scales. The full collection includes over 50 pieces on cardboard, paper, and chipboard in ink, paint, graphite, chalk, charcoal, and coffee.
Other work:
I was a partner at Vestal Design, where worked with Dave Pitman and Mike Lin on lots of stuff like Xobni's user interface and branding and information design for Intel, General Electric, and others. I also taught information design workshops for General Electric and Tata Consultancy Services in Mumbai.
I work occasionally and excitedly with Natalie Jeremijenko as part of her xDesign Lab at NYU.
Weardrobe is a site for tagging and organizing clothing online, which I created with Suzanne Xie and Richard Tong.
Cut&Paste Labs was founded by Diego Rotalde and me; we taught workshops on web design and development with open-source tools in Lima, Peru in 2006-7. Some of our students went on to found their own firms...
I've also designed a few zany things which people have enjoyed, like the DoubleSpace Kitchenette: