my $shp = SVG::Shapefile->new( %options ); $shp->render('filename.svg');
new() takes the following arguments:
Path to the ESRI shapefile to parse. The .shx and .dbf components should be in the same directory.
If defined, the name of the column from the .dbf component that should be used as the identifier for each polygon. If undefined, the ID is borrowed directly from the shapefile.
The XBase (DBF), Excel, or CSV file to read data values from.
If DataFile is an Excel spreadsheet, the name of the worksheet to read data values from.
The column from DataFile containing the polygon IDs.
The column from DataFile containing the values to be mapped.
A constant multiplier applied to all vertices in the ShapeFile. Used to scale up ShapeFile coordinates to something displayable in SVG. Defaults to 1,000,000 if not specified.
A list of two lists, each containing an [R, G, B] triplet. The first triplet is the RGB color assigned to the minimum data value, the second triplet is the color assigned to the maximum.
To install SVG::Shapefile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVG::Shapefile
CPAN shell
perl -MCPAN -e shell install SVG::Shapefile
For more information on module installation, please visit the detailed CPAN module installation guide.