/** * Returns the object representation for the feature (or feature collection) element event that the cursor of the * given <code>XMLStreamReader</code> points at. * * @param xmlStream * cursor must point at the <code>START_ELEMENT</code> event of the feature element, afterwards points at * the next event after the <code>END_ELEMENT</code> event of the feature element * @param crs * default CRS for all descendant geometry properties, can be <code>null</code> * @return object representation for the given feature element * @throws XMLStreamException * @throws UnknownCRSException * @throws XMLParsingException */ public Feature parseFeature( XMLStreamReaderWrapper xmlStream, ICRS crs ) throws XMLStreamException, XMLParsingException, UnknownCRSException { if ( schema == null ) { schema = buildAppSchema( xmlStream ); gmlStreamReader.setApplicationSchema( schema ); } if ( schema instanceof DynamicAppSchema ) { return parseFeatureDynamic( xmlStream, crs, (DynamicAppSchema) schema ); } return parseFeatureStatic( xmlStream, crs ); }
/** * Returns a {@link StreamFeatureCollection} that allows stream-based access to the members of the feature * collection that the cursor of the given <code>XMLStreamReader</code> points at. * * @param xmlStream * cursor must point at the <code>START_ELEMENT</code> event of a feature collection element * @param crs * default CRS for all descendant geometry properties, can be <code>null</code> * @return * @throws XMLStreamException */ public StreamFeatureCollection getFeatureStream( XMLStreamReaderWrapper xmlStream, ICRS crs ) throws XMLStreamException { if ( schema == null ) { schema = buildAppSchema( xmlStream ); gmlStreamReader.setApplicationSchema( schema ); } String fid = parseFeatureId( xmlStream ); QName featureName = xmlStream.getName(); FeatureCollectionType ft = (FeatureCollectionType) lookupFeatureType( xmlStream, featureName, true ); return new StreamFeatureCollection( fid, ft, this, xmlStream, crs ); }