XML::Generator::SVG::ShapeFile - Generate SAX2 events for an SVG rendering of an ESRI shapefile.
use PerlIO::gzip; use XML::SAX::Writer; use XML::Generator::SVG::ShapeFile; # see CAVEATS below open SVGZ, ">:gzip", "/path/to/my/output.svgz" || die "do the right thing, luke"; my $writer = XML::SAX::Writer->new(Output => \*SVGZ); my $svg = XML::Generator::SVG::ShapeFile->new(Handler=>$writer); $svg->set_width(1024); $svg->set_decimals(1); $svg->set_title("You are here"); $svg->set_stylesheet("foo.css"); $svg->add_point({lat=>"123",long=>"456"}); $svg->render("/path/to/shapefile");
Generate SAX2 events for an SVG rendering of an ESRI shapefile.
Depending on your input data, this package may generate huge SVG files if left uncompressed.
+ svg + metadata + rdf:Description [@rdf:about = '...'] ~ dc:title ~ dc:description ~ dc:publisher ~ dc:language - dc:date - dc:format + g [@id = 'map'] - rect [@id = 'canvas'] - path (+) ~ g [@id = 'locations'] + g [@id = '...'] (+) - title -circle
Inherits from XML::SAX::Base, so constructor arguments are the same.
Required
Set the URI used to identify the document in RDF metadata section.
Default is '#'
Set the title for the document's RDF metadata section.
Set the description for the document's RDF metadata section.
Set the publisher for the document's RDF metadata section.
Set the language for the document's RDF metadata section.
Set the URI for the document's CSS stylesheet.
Points are added as SVG circle elements.
Valid arguments are :
lat
The latitude, in decimal form, of the point you are adding.
long
The longitude, in decimal form, of the point you are adding.
id
Default is 'id-<lat>-<long>', where decimal points are replaced by '-'
title
A label for the point you are adding.
radius
The radius of the point you are adding.
Default is '1'
style
CSS stylings specific to the point you are adding.
Generate SAX2/SVG events for an ESRI shapefile.
0.2
$Date: 2004/08/21 04:13:28 $
Aaron Straup Cope <ascope@cpan.org>
http://www.webmapper.net/svg/create/
(these are the nice people who did most of the hard work for this package)
Geo::ShapeFile
Copyright (c) 2004 Aaron Straup Cope. All rights reserved.
This is free software, you may use it and distribute it under the same terms as Perl itself.
To install XML::Generator::SVG::ShapeFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Generator::SVG::ShapeFile
CPAN shell
perl -MCPAN -e shell install XML::Generator::SVG::ShapeFile
For more information on module installation, please visit the detailed CPAN module installation guide.