GML3GeometryReader extends GML3GeometryBaseReader implements GMLGeometryReader { public Curve parseCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLStreamException, XMLParsingException, UnknownCRSException { QName elName = xmlStream.getName(); GMLObjectType type = getType( xmlStream ); String gid = parseGeometryId( xmlStream ); ICRS crs = determineActiveCRS( xmlStream, defaultCRS ); List<Property> props = readStandardProperties( xmlStream, type, crs ); xmlStream.require( XMLStreamConstants.START_ELEMENT, gmlNs, "segments" ); List<CurveSegment> segments = new LinkedList<CurveSegment>(); while ( xmlStream.nextTag() == XMLStreamConstants.START_ELEMENT ) { segments.add( curveSegmentParser.parseCurveSegment( xmlStream, crs ) ); } nextElement( xmlStream ); Curve curve = geomFac.createCurve( gid, crs, segments.toArray( new CurveSegment[segments.size()] ) ); curve.setType( type ); props.addAll( readAdditionalProperties( xmlStream, type, crs ) ); curve.setProperties( props ); idContext.addObject( curve ); xmlStream.require( END_ELEMENT, elName.getNamespaceURI(), elName.getLocalPart() ); return curve; } GML3GeometryReader( GMLStreamReader gmlStream ); @Override boolean isGeometryElement( XMLStreamReader reader ); @Override boolean isGeometryOrEnvelopeElement( XMLStreamReader reader ); boolean isGeometryElement( QName elName ); boolean isGeometryOrEnvelopeElement( QName elName ); @Override Geometry parse( XMLStreamReaderWrapper xmlStream ); @Override Geometry parse( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Geometry parseGeometryOrEnvelope( XMLStreamReaderWrapper xmlStream ); @Override Geometry parseGeometryOrEnvelope( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); GeometricPrimitive parseGeometricPrimitive( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiGeometry<? extends Geometry> parseGeometricAggregate( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Geometry parseAbstractGeometricComplex( XMLStreamReaderWrapper xmlStream, CRS defaultCRS ); Geometry parseImplicitGeometry( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Curve parseAbstractCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Ring parseAbstractRing( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Surface parseAbstractSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Solid parseAbstractSolid( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Point parsePoint( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); LineString parseLineString( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Curve parseCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); OrientableCurve parseOrientableCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); LinearRing parseLinearRing( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Ring parseRing( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Polygon parsePolygon( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Surface parseSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); PolyhedralSurface parsePolyhedralSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); TriangulatedSurface parseTriangulatedSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Tin parseTin( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); OrientableSurface parseOrientableSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Solid parseSolid( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); CompositeCurve parseCompositeCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); CompositeSurface parseCompositeSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); CompositeSolid parseCompositeSolid( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); CompositeGeometry<GeometricPrimitive> parseGeometricComplex( XMLStreamReaderWrapper xmlStream,
                                                                        ICRS defaultCRS ); MultiPoint parseMultiPoint( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiCurve<?> parseMultiCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiLineString parseMultiLineString( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiSurface<?> parseMultiSurface( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiPolygon parseMultiPolygon( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiSolid parseMultiSolid( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); MultiGeometry<Geometry> parseMultiGeometry( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Envelope parseEnvelope( XMLStreamReaderWrapper xmlStream ); @Override Envelope parseEnvelope( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Point parsePointProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); LineString parseLineStringProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Curve parseCurveProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Polygon parsePolygonProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Surface parseSurfaceProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Solid parseSolidProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); GeometricPrimitive parseGeometricPrimitiveProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ); Geometry parseGeometryProperty( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS );  }
@Test public void parseCurve() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { GMLStreamReader gmlReader = getParser( "Curve.gml" ); XMLStreamReader xmlReader = gmlReader.getXMLReader(); Assert.assertEquals( XMLStreamConstants.START_ELEMENT, xmlReader.getEventType() ); Assert.assertEquals( new QName( "http: Curve curve = (Curve) gmlReader.readGeometry(); Assert.assertEquals( XMLStreamConstants.END_ELEMENT, xmlReader.getEventType() ); Assert.assertEquals( new QName( "http: Assert.assertEquals( 2, curve.getCurveSegments().size() ); Assert.assertEquals( ARC, curve.getCurveSegments().get( 0 ).getSegmentType() ); Assert.assertEquals( LINE_STRING_SEGMENT, curve.getCurveSegments().get( 1 ).getSegmentType() ); }