GML3SurfacePatchReader extends GML3GeometryBaseReader { private Cone parseCone( XMLStreamReaderWrapper xmlStream, ICRS defaultCRS ) throws XMLStreamException, XMLParsingException, UnknownCRSException { validateAttribute( xmlStream, "horizontalCurveType", "circularArc3Points" ); validateAttribute( xmlStream, "verticalCurveType", "linear" ); xmlStream.nextTag(); xmlStream.require( START_ELEMENT, gmlNs, "row" ); List<Points> grid = new ArrayList<Points>(); while ( xmlStream.getLocalName().equals( "row" ) ) { xmlStream.nextTag(); List<Point> currentRow = new LinkedList<Point>(); if ( xmlStream.getLocalName().equals( "posList" ) ) { currentRow = geometryParser.parsePosList( xmlStream, defaultCRS ); xmlStream.nextTag(); } else { while ( xmlStream.getLocalName().equals( "pos" ) || xmlStream.getLocalName().equals( "pointProperty" ) ) { if ( xmlStream.getLocalName().equals( "pos" ) ) { Point point = geometryParser.parsePoint( xmlStream, defaultCRS ); currentRow.add( point ); } else { Point point = geometryParser.parsePointProperty( xmlStream, defaultCRS ); currentRow.add( point ); } xmlStream.nextTag(); } } grid.add( geomFac.createPoints( currentRow ) ); xmlStream.require( END_ELEMENT, gmlNs, "row" ); xmlStream.nextTag(); } xmlStream.require( START_ELEMENT, gmlNs, "rows" ); xmlStream.getElementTextAsPositiveInteger(); xmlStream.require( END_ELEMENT, gmlNs, "rows" ); xmlStream.nextTag(); xmlStream.require( START_ELEMENT, gmlNs, "columns" ); xmlStream.getElementTextAsPositiveInteger(); xmlStream.require( END_ELEMENT, gmlNs, "columns" ); xmlStream.nextTag(); xmlStream.require( END_ELEMENT, gmlNs, "Cone" ); return geomFac.createCone( grid ); } GML3SurfacePatchReader( GML3GeometryReader geometryParser, GMLStreamReader gmlStream );   }
@Test public void parseCone() throws XMLStreamException, FactoryConfigurationError, IOException, XMLParsingException, UnknownCRSException { XMLStreamReaderWrapper parser = getParser( "Cone.gml" ); Cone patch = (Cone) getPatchParser().parseSurfacePatch( parser, CRSManager.getCRSRef( "EPSG:4326" ) ); Assert.assertEquals( 3, patch.getNumColumns() ); Assert.assertEquals( 2, patch.getNumRows() ); }