Not too long ago, I covered an online application from indiemapper that converts shapefiles into SVG format, a standard format for vector illustration programs like Adobe Illustrator or the open source Inkscape. One drawback of that site was the inability to color/shade the SVG output based on shapefile attribute data. Ken Hardy has a Perl utility called shptosvg that will take shapefiles and convert them into SVG format, and includes the ability to color files based on their attributes:
Features (from the website):
- Accepts source SRS specs on the command line, allowing multiple input files to have disparate coordinate systems.
- Generates the results projected to any SRS using Geo::Proj4.
- Works on multiple shapefiles at a single invocation, layering them in order into the SVG map.
- Supports specification of color and other rendering options, per source file, on the command line.
- Optionally select subset of shapes by regex on arbitrary attribute fields.
- Support coloring of shapes by value of an attribute field.
- Allow specification of a shapefile to use in scaling but not in rendering. That supports independent production of layers to be later combined in an SVG editor; they can all be scaled and translated according to the geometry of the base/largest layer to aid layering after the fact.
You’ll need to have Perl installed on your system; see the download page on the official Perl site for links to several different versions. And you’ll need to be comfortable working in a command-line interface; no GUI available yet. Ken has a page documenting usage, along with an example page that describes how he created the image above.
HT to Ken (of course).