Package net.opengis.wcs11

Examples of net.opengis.wcs11.GetCoverageType


   
    /**
     * Runs GetCoverage on the specified parameters and returns an array of coverages
     */
    GridCoverage[] executeGetCoverageKvp(Map<String, Object> raw) throws Exception {
        final GetCoverageType getCoverage = (GetCoverageType) kvpreader.read(kvpreader.createRequest(),parseKvp(raw), raw);
        return service.getCoverage(getCoverage);
    }
View Full Code Here


    /**
     * Runs GetCoverage on the specified parameters and returns an array of coverages
     */
    GridCoverage[] executeGetCoverageXml(String request) throws Exception {
        GetCoverageType getCoverage = (GetCoverageType) xmlReader.read(null, new StringReader(
                request), null);
        return service.getCoverage(getCoverage);
    }
View Full Code Here

        assertEquals("acme:bar", data.getResources().get(1));
    }
   
    @Test
    public void testWCS10GetCoverage() throws Exception {
        GetCoverageType gc = Wcs10Factory.eINSTANCE.createGetCoverageType();
        net.opengis.wcs10.SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType();
       
        CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
        GeneralEnvelope env = new GeneralEnvelope(new double[]{-123.4, 48.2}, new double[]{-120.9, 50.1});
        env.setCoordinateReferenceSystem(crs);
        BoundingBox bbox = new ReferencedEnvelope(env);

        spatialSubset.getEnvelope().clear();
        spatialSubset.getEnvelope().add(env);
        net.opengis.wcs10.DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType();
        domainSubset.setSpatialSubset(spatialSubset);
       
        gc.setSourceCoverage("acme:foo");
        gc.setDomainSubset(domainSubset);
       
        callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.0.0", gc));
       
        assertEquals("acme:foo", data.getResources().get(0));
        BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1);
View Full Code Here

   
    @Test
    public void testWCS10GetCoverageDifferentCrs() throws Exception {
        //xMin,yMin 5988504.35,851278.90 : xMax,yMax 7585113.55,1950872.01
        //xMin,yMin -95.1193,42.2802 : xMax,yMax -71.295,53.73
        GetCoverageType gc = Wcs10Factory.eINSTANCE.createGetCoverageType();
        net.opengis.wcs10.SpatialSubsetType spatialSubset = Wcs10Factory.eINSTANCE.createSpatialSubsetType();
       
        CoordinateReferenceSystem crs = CRS.decode("EPSG:3348", false);
        CoordinateReferenceSystem logCrs = CRS.decode("EPSG:4326", false);
        GeneralEnvelope env = new GeneralEnvelope(new double[]{5988504.35, 851278.90}, new double[]{7585113.55,1950872.01});
        env.setCoordinateReferenceSystem(crs);
        BoundingBox bbox = new ReferencedEnvelope(42.2802, 53.73, -95.1193, -71.295, logCrs);

        spatialSubset.getEnvelope().clear();
        spatialSubset.getEnvelope().add(env);
        net.opengis.wcs10.DomainSubsetType domainSubset = Wcs10Factory.eINSTANCE.createDomainSubsetType();
        domainSubset.setSpatialSubset(spatialSubset);
       
        gc.setSourceCoverage("acme:foo");
        gc.setDomainSubset(domainSubset);
       
        callback.operationDispatched(new Request(), op("GetCoverage", "WCS", "1.0.0", gc));
       
        assertEquals("acme:foo", data.getResources().get(0));
        BBoxAsserts.assertEqualsBbox(bbox, data.getBbox(), 0.1);
View Full Code Here

                + "  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
                + "  xsi:schemaLocation=\"http://www.opengis.net/wcs schemas/wcs/1.0.0/getCoverage.xsd\">"
                + " <sourceCoverage>nurc:Pk50095</sourceCoverage>" + "</GetCoverage>";

        try {
            @SuppressWarnings("unused")
      GetCoverageType cov = (GetCoverageType) reader.read(null, new StringReader(request),null);
            fail("This request is not valid!!!");
        } catch (WcsException e) {
            // ok, we do expect a validation exception in fact
            /*
 
View Full Code Here

                "      <format>TIFF</format>" + //
                "    </output>" + //
                "</GetCoverage>";

        // smoke test, we only try out a very basic request
        GetCoverageType gc = (GetCoverageType) reader.read(null, new StringReader(request), null);
        assertEquals("WCS", gc.getService());
        assertEquals("1.0.0", gc.getVersion());
        assertEquals("nurc:Pk50095", gc.getSourceCoverage());

        GeneralEnvelope envelope = ((GeneralEnvelope) gc.getDomainSubset().getSpatialSubset().getEnvelope().get(0));
        assertEquals("EPSG:32633", CRS.lookupIdentifier(envelope.getCoordinateReferenceSystem(),true));
        assertEquals(347649.93086859107, envelope.getLowerCorner().getOrdinate(0), 0);
        assertEquals(5176214.082539256, envelope.getLowerCorner().getOrdinate(1), 0);
        assertEquals(370725.976428591, envelope.getUpperCorner().getOrdinate(0), 0);
        assertEquals(5196961.352859256, envelope.getUpperCorner().getOrdinate(1), 0);
        assertNotNull(gc.getOutput().getCrs());
        assertEquals("EPSG:4326", gc.getOutput().getCrs().getValue());
        assertNotNull(gc.getOutput().getFormat());
        assertEquals("TIFF", gc.getOutput().getFormat().getValue());
    }
View Full Code Here

                "      <crs>EPSG:4326</crs>" + //
                "      <format>TIFF</format>" + //
                "    </output>" + //
                "</GetCoverage>";

        GetCoverageType gc = (GetCoverageType) reader.read(null, new StringReader(request), null);
        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(grid.getAxisName().get(1), "Row");

        GridEnvelope gridLimits = grid.getLimits();
        assertEquals(0, gridLimits.getLow(0));
        assertEquals(0, gridLimits.getLow(1));
        assertEquals(544, gridLimits.getHigh(0));
        assertEquals(489, gridLimits.getHigh(1));

        RangeSubsetType rangeSet = gc.getRangeSubset();
        AxisSubsetType axisSubset = (AxisSubsetType) rangeSet.getAxisSubset().get(0);
        assertEquals("Band", axisSubset.getName());
        assertEquals(axisSubset.getSingleValue().size(), 0);
        assertEquals(axisSubset.getInterval().size(), 1);
View Full Code Here

    public String getAttachmentFileName(Object value, Operation operation) {
        if (!(operation.getParameters()[0] instanceof GetCoverageType))
            throw new WcsException("Cannot handle object of type: "
                    + operation.getParameters()[0].getClass());

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);
        return getCoverage.getSourceCoverage() + "." + delegate.getFileExtension(outputFormat);
    }
View Full Code Here

    public String getMimeType(Object value, Operation operation) throws ServiceException {
        if (!(operation.getParameters()[0] instanceof GetCoverageType))
            throw new WcsException("Cannot handle object of type: "
                    + operation.getParameters()[0].getClass());

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);

        return delegate.getMimeType(outputFormat);
    }
View Full Code Here

    @Override
    public boolean canHandle(Operation operation) {
        if (!(operation.getParameters()[0] instanceof GetCoverageType))
            return false;

        GetCoverageType getCoverage = (GetCoverageType) operation.getParameters()[0];
        String outputFormat = getCoverage.getOutput().getFormat().getValue();
        CoverageResponseDelegate delegate = getResponseDelegate(outputFormat);

        return delegate.canProduce(outputFormat);
    }
View Full Code Here

TOP

Related Classes of net.opengis.wcs11.GetCoverageType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.