Package org.geotools.gml2.simple
Class GMLWriter
Object
GMLWriter
Helper class writing out GML elements and coordinates. Geared towards efficiency, write out elements and ordinate
lists with the minimim amount of garbage generation
- Author:
- Andrea Aime - GeoSolutions
-
Constructor Summary
ConstructorsConstructorDescriptionGMLWriter
(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, boolean padWithZeros, String gmlPrefix) Create a new content handlerGMLWriter
(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, boolean padWithZeros, String gmlPrefix, boolean encodeMeasures) Create a new content handlerGMLWriter
(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, String gmlPrefix) Create a new content handler -
Method Summary
Modifier and TypeMethodDescriptionvoid
Writes a GML2 coordinates elementvoid
void
void
endPrefixMapping
(String prefix) void
ordinate
(double x) Writes a single ordinate, without wrapping it inside any elementvoid
position
(double x, double y, double z) Writes a single x/y position, without wrapping it in any elementvoid
position
(CoordinateSequence coordinates) Encodes the provided coordinates sequence, if encoding of measures is enabled this method will encode all the available ordinates.void
posList
(CoordinateSequence coordinateSequence) Write a GML3 posListvoid
setDocumentLocator
(Locator locator) void
void
startElement
(QualifiedName qn, Attributes atts) void
startPrefixMapping
(String prefix, String uri)
-
Constructor Details
-
GMLWriter
public GMLWriter(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, String gmlPrefix) Create a new content handler- Parameters:
delegate
- The actual XML writernamespaces
- The namespaces known to the EncodernumDecimals
- How many decimals to preserve when writing ordinatesforceDecimal
- If xs:decimal compliant encoding should be used, or notgmlPrefix
- The GML namespace prefix
-
GMLWriter
public GMLWriter(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, boolean padWithZeros, String gmlPrefix) Create a new content handler- Parameters:
delegate
- The actual XML writernamespaces
- The namespaces known to the EncodernumDecimals
- How many decimals to preserve when writing ordinatesforceDecimal
- If xs:decimal compliant encoding should be used, or notpadWithZeros
- If apply zero paddinggmlPrefix
- The GML namespace prefix
-
GMLWriter
public GMLWriter(ContentHandler delegate, NamespaceSupport namespaces, int numDecimals, boolean forceDecimal, boolean padWithZeros, String gmlPrefix, boolean encodeMeasures) Create a new content handler- Parameters:
delegate
- The actual XML writernamespaces
- The namespaces known to the EncodernumDecimals
- How many decimals to preserve when writing ordinatesforceDecimal
- If xs:decimal compliant encoding should be used, or notgmlPrefix
- The GML namespace prefixencodeMeasures
- TRUE if coordinates measures should be included
-
-
Method Details
-
setDocumentLocator
-
startDocument
- Throws:
SAXException
- See Also:
-
endDocument
- Throws:
SAXException
- See Also:
-
startPrefixMapping
-
endPrefixMapping
- Throws:
SAXException
- See Also:
-
startElement
-
endElement
-
coordinates
Writes a GML2 coordinates element- Throws:
SAXException
-
position
Writes a single x/y position, without wrapping it in any element- Throws:
SAXException
-
position
Encodes the provided coordinates sequence, if encoding of measures is enabled this method will encode all the available ordinates.- Parameters:
coordinates
- the coordinates sequence- Throws:
SAXException
-
ordinate
Writes a single ordinate, without wrapping it inside any element- Throws:
SAXException
-
posList
Write a GML3 posList- Throws:
SAXException
-