
Plot Statistics Against Shapes #44
Chapter 4, Mapping (on) the Web
|
197
HACK
(e.g., “Number of Voters”). Look carefully at choropleth maps you see in
the press; what they represent can easily be illusory! Not all data should be
uploaded to Indymapper; if you can normalize it, for example, by turning
“Polling place incidents” into “Polling place incidents per 1,000 registered
voters,” then do so. Absolute values are best represented on a propor-
tional symbol map, showing an icon shrink or grow according to the
mapped value.
The rest of this hack should give you a clearer idea of what
SVG::Shapefile
and Indymapper can do, and illustrate how to “roll your own” map with
code available from the Perl CPAN repository.
Rolling Your Own
Installing modules from CPAN is easy. As your system’s root user, type:
#> perl -MCPAN -e shell
cpan> install SVG::Shapefile
cpan> install DBD::Excel
For more in-depth instructions on installing modules from CPAN, see “Set
Up an OpenGuide for Your Hometown”
[Hack #97].
You can use
SVG::Shapefile to plot a range of colors: one representing a low
value, the other a high value, with a blend to and from white between them.
Figure 4-15. Plotting stats against shapes on the Web