org.geotools.svg
Class GenerateSVG
java.lang.Object
org.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.
- Version:
- $Id: GenerateSVG.java 17705 2006-01-23 00:45:01Z desruisseaux $
- Author:
- James Macgill, PennState
Constructor Summary |
GenerateSVG()
Creates a new instance of GenerateSVG. |
Method Summary |
java.awt.Dimension |
getCanvasSize()
|
void |
go(MapContext map,
com.vividsolutions.jts.geom.Envelope env,
java.io.OutputStream 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 |
GenerateSVG
public GenerateSVG()
- Creates a new instance of GenerateSVG.
go
public void go(MapContext map,
com.vividsolutions.jts.geom.Envelope env,
java.io.OutputStream out)
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException
- Generate an SVG document from the supplied information.
Note, call setCavasSize first if you want to change the default output size.
- Parameters:
map
- Contains the layers (features + styles) to be renderedenv
- The portion of the map to generate an SVG fromout
- Stream to write the resulting SVG out to (probable should be a new file)
- Throws:
java.io.IOException
- Should anything go wrong whilst writing to 'out'
javax.xml.parsers.ParserConfigurationException
- If critical XML tools are missing from the classpath
getCanvasSize
public java.awt.Dimension getCanvasSize()
setCanvasSize
public void setCanvasSize(java.awt.Dimension size)
Copyright © GeoTools. All Rights Reserved.