/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType(); List<Node> envelopes = node.getChildren("Envelope"); for (Node envelopeNode : envelopes) { ReferencedEnvelope envelope = (ReferencedEnvelope) envelopeNode.getValue(); EnvelopeType env = Gml4wcsFactory.eINSTANCE.createEnvelopeType(); env.setSrsName(CRS.lookupIdentifier(envelope.getCoordinateReferenceSystem(), true)); DirectPositionType pos1 = Gml4wcsFactory.eINSTANCE.createDirectPositionType(); DirectPositionType pos2 = Gml4wcsFactory.eINSTANCE.createDirectPositionType(); pos1.setDimension(BigInteger.valueOf(2)); pos2.setDimension(BigInteger.valueOf(2)); pos1.setValue(Arrays.asList(envelope.getMinX(), envelope.getMinY())); pos2.setValue(Arrays.asList(envelope.getMaxX(), envelope.getMaxY())); env.getPos().add(pos1); env.getPos().add(pos2); spatialSubset.getEnvelope().add(envelope); } List<Node> gridsNode = node.getChildren("Grid"); for (Node grid : gridsNode) spatialSubset.getGrid().add(grid.getValue()); return spatialSubset; }
final EList grids = spatialSubset.getGrid(); if (grids.size() == 0) throw new IllegalArgumentException(
spatialSubset.getGrid().add(grid); domainSubset.setSpatialSubset(spatialSubset); domainSubset.setTemporalSubset(timeSequence);
assertEquals(1, gc.getRangeSubset().getAxisSubset().size()); GridType grid = (GridType) gc.getDomainSubset().getSpatialSubset().getGrid().get(0); assertEquals(grid.getSrsName(), "EPSG:4326"); assertEquals(grid.getAxisName().get(0), "Column");
assertEquals(1, gc.getRangeSubset().getAxisSubset().size()); GridType grid = (GridType) gc.getDomainSubset().getSpatialSubset().getGrid().get(0); assertEquals(grid.getSrsName(), "EPSG:4326"); assertEquals(grid.getAxisName().get(0), "Column");