public class XmlSimpleFeatureParser extends Object implements GetParser<SimpleFeature>
GetParser
implementation that uses plain xml pull to parse a GetFeature
response.Constructor and Description |
---|
XmlSimpleFeatureParser(InputStream getFeatureResponseStream,
SimpleFeatureType targetType,
QName featureDescriptorName,
String axisOrder) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the parser.
|
FeatureType |
getFeatureType()
Get the feature type that the parser is targeting.
|
int |
getNumberOfFeatures()
Returns the number of features if advertised by the server and the parser was able to get
that information for example from the
wfs:FeatureCollection "numberOfFeatures" xml
attribute, or -1 if unknown. |
SimpleFeature |
parse() |
void |
setGeometryFactory(GeometryFactory geometryFactory)
Set the geometry factory.
|
public XmlSimpleFeatureParser(InputStream getFeatureResponseStream, SimpleFeatureType targetType, QName featureDescriptorName, String axisOrder) throws IOException
IOException
public void setGeometryFactory(GeometryFactory geometryFactory)
GetParser
setGeometryFactory
in interface GetParser<SimpleFeature>
geometryFactory
- The geometry factory to use.public FeatureType getFeatureType()
GetParser
getFeatureType
in interface GetParser<SimpleFeature>
public int getNumberOfFeatures()
GetParser
wfs:FeatureCollection
"numberOfFeatures" xml
attribute, or -1
if unknown.getNumberOfFeatures
in interface GetParser<SimpleFeature>
-1
if unknownpublic void close() throws IOException
GetParser
close
in interface GetParser<SimpleFeature>
IOException
- Throws IOException if there was a problem closing the parser.public SimpleFeature parse() throws IOException
parse
in interface GetParser<SimpleFeature>
null
if there are no more features to
parse.IOException
Copyright © 1996–2022 Geotools. All rights reserved.