Just thought I'd share my first Shoes app that came out of yesterday's
hacking. (I suppose I could have also mentioned that passing the bad color
name to background with a flow/stack also seemed to completely black out my
OS X Leopard Shoes app, but that's another story!)
First, the screenshot:
  http://farm4.static.flickr.com/3095/2801694916_1a051349b4_b.jpg
  (http://flickr.com/photos/wu_135/2801694916/sizes/l/)

As I mentioned on mapnik-users@, on the left, you have an image PNG rendered
by Mapnik. On the right, a simple XML editor, and below a "Render!" button.
(Oh and I noticed that OS X copy/paste bindings don't quite work on the text
box, le sigh.)

The hack works by shelling out to a pre-compiled C++ binary (although a Py
script would do), which re-renders the image when you hit "Render".

Here's the source code: http://gist.github.com/7382 -- it's a few dozen
lines of Shoesian code.

(You can download Mapnik here: http://mapnik.org/ -- and if you're curious,
the image is rendered using libre/gratis USGS state boundaries (SHP)
Shapefiles, with spatial geometry queried from a local PostGIS DB sourced
from the OpenStreetMap project. Alas, getting that entire map-rendering
stack running on a OS X machine is a little bit of a hassle, but it's
slightly easier on Linux.

Mapnik doesn't have any Ruby bindings yet, and the OSM planet dataset is
huuuge, but perhaps one day some intrepid soul will implement a Ruby binding
for Mapnik, and create a minified extract of OSM for SQLite, making it
possible for Shoes'ers and HacketyHackers everywhere to more easily play
with their own Maps!)

~L

Reply via email to