public class GMLReader extends Object
Geometry.
An example of the GML2 format handled is:
24824.045318333192,38536.15071012041 26157.378651666528,37567.42733944659 26666.666,36000.0 26157.378651666528,34432.57266055341 24824.045318333192,33463.84928987959 23175.954681666804,33463.84928987959 21842.621348333472,34432.57266055341 21333.333,36000.0 21842.621348333472,37567.42733944659 23175.954681666808,38536.15071012041
The reader ignores namespace prefixes, and disables both the validation and namespace options on the
SAXParser. This class requires the presence of a SAX Parser available via the
SAXParserFactory.newInstance() method.
A specification of the GML XML format can be found at the OGC web site: http://www.opengeospatial.org/.
It is the caller's responsibility to ensure that the supplied PrecisionModel matches the precision of the incoming data. If a lower precision for the data is required, a subsequent process must be run on the data to reduce its precision.
To parse and build geometry directly from a SAX stream, see GMLHandler.
GMLHandler
| Constructor and Description |
|---|
GMLReader()
|
| Modifier and Type | Method and Description |
|---|---|
Geometry |
read(Reader
Reads a GML2 Geometry from a
Reader into a single
Geometry If a collection of Geometries is found, a
GeometryCollection is returned.
|
Geometry |
read(String
Reads a GML2 Geometry from a
String into a single
Geometry If a collection of geometries is found, a
GeometryCollection is returned.
|
public Geometryread(String gml, GeometryFactory geometryFactory) throws SAXException , IOException , ParserConfigurationException
Geometry If a collection of geometries is found, a
GeometryCollection is returned.
gml - The GML String to parse
geometryFactory - When null, a default will be used.
ParserConfigurationException -
IOException -
SAXException -
read(Reader, GeometryFactory)
public Geometryread(Reader reader, GeometryFactory geometryFactory) throws SAXException , IOException , ParserConfigurationException
Reader into a single
Geometry If a collection of Geometries is found, a
GeometryCollection is returned.
reader - The input source
geometryFactory - When null, a default will be used.
SAXException -
IOException -
ParserConfigurationException