GML3CurveSegmentReader extends GML3GeometryBaseReader { private Clothoid parseClothoid( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLParsingException, XMLStreamException, UnknownCRSException { xmlStream.nextTag(); xmlStream.require( START_ELEMENT, gmlNs, "refLocation" ); xmlStream.nextTag(); xmlStream.require( START_ELEMENT, gmlNs, "AffinePlacement" ); AffinePlacement referenceLocation = parseAffinePlacement( xmlStream, defaultCRS ); xmlStream.nextTag(); xmlStream.require( END_ELEMENT, gmlNs, "refLocation" ); xmlStream.nextTag(); double scaleFactor = xmlStream.getElementTextAsDouble( gmlNs, "scaleFactor" ); xmlStream.nextTag(); double startParameter = xmlStream.getElementTextAsDouble( gmlNs, "startParameter" ); xmlStream.nextTag(); double endParameter = xmlStream.getElementTextAsDouble( gmlNs, "endParameter" ); xmlStream.nextTag(); xmlStream.require( END_ELEMENT, gmlNs, "Clothoid" ); return geomFac.createClothoid( referenceLocation, scaleFactor, startParameter, endParameter ); } GML3CurveSegmentReader( GML3GeometryReader geometryParser, GMLStreamReader gmlStream );   }
@Test public void parseClothoid() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { Clothoid segment = (Clothoid) getParser().parseCurveSegment( getReader( "Clothoid.gml" ), CRSManager.getCRSRef( "EPSG:4326" ) ); Assert.assertEquals( 47.0, segment.getReferenceLocation().getLocation().get0() ); Assert.assertEquals( 11.0, segment.getReferenceLocation().getLocation().get1() ); Assert.assertEquals( 13.0, segment.getReferenceLocation().getLocation().get2() ); Assert.assertEquals( 2, segment.getReferenceLocation().getRefDirections().size() ); Assert.assertEquals( 3.0, segment.getReferenceLocation().getRefDirections().get( 0 ).get0() ); Assert.assertEquals( 4.0, segment.getReferenceLocation().getRefDirections().get( 0 ).get1() ); Assert.assertEquals( 8.0, segment.getReferenceLocation().getRefDirections().get( 0 ).get2() ); Assert.assertEquals( 5.0, segment.getReferenceLocation().getRefDirections().get( 1 ).get0() ); Assert.assertEquals( 6.0, segment.getReferenceLocation().getRefDirections().get( 1 ).get1() ); Assert.assertEquals( 9.0, segment.getReferenceLocation().getRefDirections().get( 1 ).get2() ); Assert.assertEquals( 2, segment.getReferenceLocation().getInDimension() ); Assert.assertEquals( 3, segment.getReferenceLocation().getOutDimension() ); Assert.assertEquals( 0.9, segment.getScaleFactor() ); Assert.assertEquals( -2.5, segment.getStartParameter() ); Assert.assertEquals( 3.0, segment.getEndParameter() ); }