
Plot Statistics Against Shapes #44
Chapter 4, Mapping (on) the Web
|
195
HACK
Hacking the Hack
What if you’re primarily interested in quakes in your immediate neighbor-
hood? In that case, you can specify a bounding box for your map in terms of
latitude and longitude in your config.xml file. Here’s an example that covers
the San Francisco Bay Area:
<north>38.20</north>
<south>37.30</south>
<west>-121.87</west>
<east>-123.00</east>
If a bounding box is specified, worldKit will only display items in the feed
within the bounding box. You only need to provide an image that corre-
sponds to your location. If you don’t have a map of your area handy, we can
offer a couple of suggestions on how to obtain one easily.
First, you might try MapProxy (http://brainoff.com/worldkit/mapproxy/), a
simple web interface to TerraServer, which can fetch U.S. topo maps or
aerial photos, given a ZIP Code and distance. MapProxy generates the corre-
sponding worldKit bounding box configuration for you, as well.
Failing that, you can take one of the world maps, and extract the area corre-
sponding to your bounding box with Photoshop or ImageMagick. To con-
vert the bounding box in latitude and longitude to x- and y-coordinates in
the image, use the following formulas from Table 4-1.
—Mikel Maron
HACK
#44
Plot Statistics Against Shapes Hack #44
Easily render demographic maps in SVG from shapes and CSV or Excel files.
In late 2003,