/** * Returns the object representation of a <code><gml:Arc></code> element. Consumes all corresponding events * from the associated <code>XMLStream</code>. * <ul> * <li>Precondition: cursor must point at the <code>START_ELEMENT</code> event (<gml:Arc>)</li> * <li>Postcondition: cursor points at the corresponding <code>END_ELEMENT</code> event (</gml:Arc>)</li> * </ul> * * @param defaultCRS * default CoordinateSystem for the geometry, this is propagated if no deeper <code>srsName</code> * attribute is specified * @return corresponding {@link Arc} object * @throws XMLParsingException * if a syntactical (or semantic) error is detected in the element * @throws XMLStreamException * @throws UnknownCRSException */ private Arc parseArc( 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:Arc' element. Must specify exactly three control points, but contains " + points.size() + "."; throw new XMLParsingException( xmlStream, msg ); } xmlStream.require( XMLStreamConstants.END_ELEMENT, gmlNs, "Arc" ); return geomFac.createArc( points.get( 0 ), points.get( 1 ), points.get( 2 ) ); }
pos = ( (Arc) segment ).getControlPoints(); pos = transform( pos, trans ); transformedSegment = geomFactory.createArc( pos.get( 0 ), pos.get( 1 ), pos.get( 2 ) ); break; case ARC_BY_BULGE: