Aaron Straup Cope > XML-Generator-SVG-ShapeFile-0.2 > XML::Generator::SVG::ShapeFile

Download:
XML-Generator-SVG-ShapeFile-0.2.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 0.2   Source  

NAME ^

XML::Generator::SVG::ShapeFile - Generate SAX2 events for an SVG rendering of an ESRI shapefile.

SYNOPSIS ^

 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");

DESCRIPTION ^

Generate SAX2 events for an SVG rendering of an ESRI shapefile.

CAVEATS ^

Depending on your input data, this package may generate huge SVG files if left uncompressed.

DOCUMENT STRUCTURE ^

 + 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

PACKAGE METHODS ^

__PACKAGE__->new(\%args)

Inherits from XML::SAX::Base, so constructor arguments are the same.

OBJECT METHODS ^

$obj->set_width($int)

Required

$obj->set_decimals($int)

Required

$obj->set_uri($str)

Set the URI used to identify the document in RDF metadata section.

Default is '#'

$obj->set_title($str)

Set the title for the document's RDF metadata section.

$obj->set_description($str)

Set the description for the document's RDF metadata section.

$obj->set_publisher($str)

Set the publisher for the document's RDF metadata section.

$obj->set_language($str)

Set the language for the document's RDF metadata section.

$obj->set_stylesheet($str)

Set the URI for the document's CSS stylesheet.

$obj->add_point(\%args)

Points are added as SVG circle elements.

Valid arguments are :

$obj->render($path)

Generate SAX2/SVG events for an ESRI shapefile.

VERSION ^

0.2

DATE ^

$Date: 2004/08/21 04:13:28 $

AUTHOR ^

Aaron Straup Cope <ascope@cpan.org>

SEE ALSO ^

http://www.webmapper.net/svg/create/

(these are the nice people who did most of the hard work for this package)

Geo::ShapeFile

LICENSE ^

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.

syntax highlighting: