com.vividsolutions.jts.io.gml2
Class GMLWriter

java.lang.Object
  extended bycom.vividsolutions.jts.io.gml2.GMLWriter

public class GMLWriter
extends java.lang.Object

Writes JTS Geometries as GML2 into the writer provided, or as a string.

Author:
David Zwiers, Vivid Solutions.

Constructor Summary
GMLWriter()
           
 
Method Summary
 void setMaxCoordinatesPerLine(int arg)
          Sets the number of coordinates printed per line.
 void setPrefix(java.lang.String prefix)
          Allows the user to force a prefix for the GML namespace.
 void setStartingIndentIndex(int arg)
          Sets the starting index for preaty printing
 java.lang.String write(Geometry geom)
           
 void write(Geometry geom, java.io.Writer writer)
          Writes the JTS Geometry provided as GML2 into the writer provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GMLWriter

public GMLWriter()
Method Detail

setPrefix

public void setPrefix(java.lang.String prefix)
Allows the user to force a prefix for the GML namespace. In XML blobs, the user may wish to leave the polygons un-qualified, thus setting the prefix to the empty string

Parameters:
prefix -

setStartingIndentIndex

public void setStartingIndentIndex(int arg)
Sets the starting index for preaty printing

Parameters:
arg -

setMaxCoordinatesPerLine

public void setMaxCoordinatesPerLine(int arg)
Sets the number of coordinates printed per line. Use full when configuring preaty printing.

Parameters:
arg -

write

public java.lang.String write(Geometry geom)
                       throws java.io.IOException
Parameters:
geom -
Returns:
String GML2 Encoded Geometry
Throws:
java.io.IOException

write

public void write(Geometry geom,
                  java.io.Writer writer)
           throws java.io.IOException
Writes the JTS Geometry provided as GML2 into the writer provided.

Parameters:
geom - Geometry to encode
writer - Stream to encode to.
Throws:
java.io.IOException