Package org.geotools.gml.stream
Class XmlStreamGeometryReader
Object
XmlStreamGeometryReader
Parse GML geometries from a StAX XMLStreamReader.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of the XML Stream Geometry Reader.XmlStreamGeometryReader
(XMLStreamReader reader, GeometryFactory geometryFactory) Create a new instance of the XML Stream Geometry Reader.XmlStreamGeometryReader
(XMLStreamReader reader, GeometryFactory geometryFactory, CurvedGeometryFactory curvedGeometryFactory) Create a new instance of the XML Stream Geometry Reader. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Reads the nextGeometry
from the stream.void
setGeometryFactory
(GeometryFactory geometryFactory) void
setInvertAxisNeeded
(Predicate<CoordinateReferenceSystem> invertAxisNeeded) By default axis are not inverted, you can provide a predicate that determines whether axes need to be inverted for a CRS (only called once per CRS).void
setUnsafeXMLAllowed
(boolean unsafeXMLAllowed)
-
Field Details
-
DEFAULT_CURVE_TOLERANCE
public static final double DEFAULT_CURVE_TOLERANCE- See Also:
-
-
Constructor Details
-
XmlStreamGeometryReader
Create a new instance of the XML Stream Geometry Reader.- Parameters:
reader
- the reader providing the data to parse
-
XmlStreamGeometryReader
Create a new instance of the XML Stream Geometry Reader.- Parameters:
reader
- the reader providing the data to parsegeometryFactory
- a specificGeometryFactory
to use for constructing geometries
-
XmlStreamGeometryReader
public XmlStreamGeometryReader(XMLStreamReader reader, GeometryFactory geometryFactory, CurvedGeometryFactory curvedGeometryFactory) Create a new instance of the XML Stream Geometry Reader.- Parameters:
reader
- the reader providing the data to parsegeometryFactory
- a specificGeometryFactory
to use for constructing geometriescurvedGeometryFactory
- a specificCurvedGeometryFactory
to use for constructing curved geometries
-
-
Method Details
-
setGeometryFactory
-
getGeometryFactory
-
isUnsafeXMLAllowed
public boolean isUnsafeXMLAllowed() -
setUnsafeXMLAllowed
public void setUnsafeXMLAllowed(boolean unsafeXMLAllowed) - Parameters:
unsafeXMLAllowed
- true if you want to parse from an XMLStreamReader not configured for safe XML parsing (XMLInputFactory.SUPPORT_DTD is true)
-
setInvertAxisNeeded
By default axis are not inverted, you can provide a predicate that determines whether axes need to be inverted for a CRS (only called once per CRS). -
readGeometry
public Geometry readGeometry() throws NoSuchAuthorityCodeException, FactoryException, XMLStreamException, IOExceptionReads the nextGeometry
from the stream.Precondition: parser cursor positioned on a geometry property (eg.
gml:Point
, etc).Postcondition: parser gets positioned at the end tag of the element it started parsing the geometry at.
- Throws:
XMLStreamException
- when the parser cursor is not positioned on the expected elementNoSuchAuthorityCodeException
- when parsing the EPSG code failsFactoryException
- when finding an EPSG parser failsIOException
- unkown error
-