Class GenerateSVG

  extended byorg.geotools.svg.GenerateSVG

public class GenerateSVG
extends java.lang.Object

This is a simple support class which allows you to generate an SVG file from a map. To use, setup a Map object with the layers you want to render, create an envelope for the region to be drawn and pass in an OutputStream (probably attached to a new file) for the resulting SVG information to be stored in. Optionaly you can change the default size of the SVG cavas (in effect increasing the resolution) by calling setCavasSize before calling go.

$Id: 17705 2006-01-23 00:45:01Z desruisseaux $
James Macgill, PennState

Constructor Summary
          Creates a new instance of GenerateSVG.
Method Summary
 java.awt.Dimension getCanvasSize()
 void go(MapContext map, com.vividsolutions.jts.geom.Envelope env, out)
          Generate an SVG document from the supplied information.
 void setCanvasSize(java.awt.Dimension size)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public GenerateSVG()
Creates a new instance of GenerateSVG.

Method Detail


public void go(MapContext map,
               com.vividsolutions.jts.geom.Envelope env,
Generate an SVG document from the supplied information. Note, call setCavasSize first if you want to change the default output size.

map - Contains the layers (features + styles) to be rendered
env - The portion of the map to generate an SVG from
out - Stream to write the resulting SVG out to (probable should be a new file)
Throws: - Should anything go wrong whilst writing to 'out'
javax.xml.parsers.ParserConfigurationException - If critical XML tools are missing from the classpath


public java.awt.Dimension getCanvasSize()


public void setCanvasSize(java.awt.Dimension size)

Copyright © GeoTools. All Rights Reserved.