GML3CurveSegmentReader extends GML3GeometryBaseReader { private Circle parseCircle( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLParsingException, XMLStreamException, UnknownCRSException { validateInterpolationAttribute( xmlStream, "circularArc3Points" ); xmlStream.nextTag(); Points points = parseControlPoints( xmlStream, defaultCRS ); if ( points.size() != 3 ) { String msg = "Error in 'gml:Circle' element. Must specify exactly three control points, but contains " + points.size() + "."; throw new XMLParsingException( xmlStream, msg ); } xmlStream.require( XMLStreamConstants.END_ELEMENT, gmlNs, "Circle" ); return geomFac.createCircle( points.get( 0 ), points.get( 1 ), points.get( 2 ) ); } GML3CurveSegmentReader( GML3GeometryReader geometryParser, GMLStreamReader gmlStream );   }
@Test public void parseCircle() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { Circle circle = (Circle) getParser().parseCurveSegment( getReader( "Circle.gml" ), null ); Assert.assertEquals( 1, circle.getNumArcs() ); Assert.assertEquals( 3, circle.getControlPoints().size() ); Assert.assertEquals( 2.0, circle.getPoint1().get0() ); Assert.assertEquals( 0.0, circle.getPoint1().get1() ); Assert.assertEquals( 0.0, circle.getPoint2().get0() ); Assert.assertEquals( 2.0, circle.getPoint2().get1() ); Assert.assertEquals( -2.0, circle.getPoint3().get0() ); Assert.assertEquals( 0.0, circle.getPoint3().get1() ); }