GML3CurveSegmentReader extends GML3GeometryBaseReader { private ArcString parseArcString( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLParsingException, XMLStreamException, UnknownCRSException { validateInterpolationAttribute( xmlStream, "circularArc3Points" ); xmlStream.nextTag(); Points points = parseControlPoints( xmlStream, defaultCRS ); if ( points.size() < 3 || points.size() % 2 != 1 ) { String msg = "Error in 'gml:ArcString' element. Invalid number of points (=" + points.size() + ")."; throw new XMLParsingException( xmlStream, msg ); } xmlStream.require( XMLStreamConstants.END_ELEMENT, gmlNs, "ArcString" ); return geomFac.createArcString( points ); } GML3CurveSegmentReader( GML3GeometryReader geometryParser, GMLStreamReader gmlStream );   }
@Test public void parseArcString() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { ArcString arc = (ArcString) getParser().parseCurveSegment( getReader( "ArcString.gml" ), null ); Assert.assertEquals( 3, arc.getNumArcs() ); Assert.assertEquals( 7, arc.getControlPoints().size() ); Assert.assertEquals( 2.0, arc.getControlPoints().get( 0 ).get0() ); Assert.assertEquals( 0.0, arc.getControlPoints().get( 0 ).get1() ); Assert.assertEquals( 0.0, arc.getControlPoints().get( 1 ).get0() ); Assert.assertEquals( 2.0, arc.getControlPoints().get( 1 ).get1() ); Assert.assertEquals( -2.0, arc.getControlPoints().get( 2 ).get0() ); Assert.assertEquals( 0.0, arc.getControlPoints().get( 2 ).get1() ); Assert.assertEquals( -4.0, arc.getControlPoints().get( 3 ).get0() ); Assert.assertEquals( -2.0, arc.getControlPoints().get( 3 ).get1() ); Assert.assertEquals( -6.0, arc.getControlPoints().get( 4 ).get0() ); Assert.assertEquals( 0.0, arc.getControlPoints().get( 4 ).get1() ); Assert.assertEquals( -8.0, arc.getControlPoints().get( 5 ).get0() ); Assert.assertEquals( 2.0, arc.getControlPoints().get( 5 ).get1() ); Assert.assertEquals( -10.0, arc.getControlPoints().get( 6 ).get0() ); Assert.assertEquals( 0.0, arc.getControlPoints().get( 6 ).get1() ); }