GML3CurveSegmentReader extends GML3GeometryBaseReader { private OffsetCurve parseOffsetCurve( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLParsingException, XMLStreamException, UnknownCRSException { xmlStream.nextTag(); xmlStream.require( XMLStreamConstants.START_ELEMENT, gmlNs, "offsetBase" ); xmlStream.nextTag(); Curve baseCurve = geometryParser.parseAbstractCurve( xmlStream, defaultCRS ); xmlStream.nextTag(); xmlStream.require( XMLStreamConstants.END_ELEMENT, gmlNs, "offsetBase" ); xmlStream.nextTag(); xmlStream.require( XMLStreamConstants.START_ELEMENT, gmlNs, "distance" ); Length distance = parseLengthType( xmlStream ); Point direction = null; if ( xmlStream.nextTag() == START_ELEMENT ) { xmlStream.require( XMLStreamConstants.START_ELEMENT, gmlNs, "refDirection" ); direction = parseDirectPositionType( xmlStream, defaultCRS ); xmlStream.nextTag(); } xmlStream.require( XMLStreamConstants.END_ELEMENT, gmlNs, "OffsetCurve" ); return geomFac.createOffsetCurve( baseCurve, direction, distance ); } GML3CurveSegmentReader( GML3GeometryReader geometryParser, GMLStreamReader gmlStream );   }
@Test public void parseOffsetCurve() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { OffsetCurve segment = (OffsetCurve) getParser().parseCurveSegment( getReader( "OffsetCurve.gml" ), CRSManager.getCRSRef( "EPSG:4326" ) ); Assert.assertEquals( 1.0, segment.getDistance( null ).getValueAsDouble() ); Assert.assertEquals( 0.0, segment.getDirection().get0() ); Assert.assertEquals( 1.0, segment.getDirection().get1() ); }