Examples of WCSInfo


Examples of org.geoserver.wcs.WCSInfo

        gs.save(info);
    }

    protected void setOutputLimit(int kbytes) {
        GeoServer gs = getGeoServer();
        WCSInfo info = gs.getService(WCSInfo.class);
        info.setMaxOutputMemory(kbytes);
        gs.save(info);
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

        return coverage;
    }

    protected void setInputLimit(int kbytes) {
        GeoServer gs = getGeoServer();
        WCSInfo info = gs.getService(WCSInfo.class);
        info.setMaxInputMemory(kbytes);
        gs.save(info);
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

        gs.save(info);
    }

    protected void setOutputLimit(int kbytes) {
        GeoServer gs = getGeoServer();
        WCSInfo info = gs.getService(WCSInfo.class);
        info.setMaxOutputMemory(kbytes);
        gs.save(info);
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

*/
public class GetCapabilitiesTest extends WCSTestSupport {
   
    @Before
    public void cleanupLimitedSRS() {
        WCSInfo service = getGeoServer().getService(WCSInfo.class);
        service.getSRS().clear();
        getGeoServer().save(service);
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

        // print(dom);
        NodeList list = xpath.getMatchingNodes("//wcs:ServiceMetadata/wcs:Extension/wcscrs:crsSupported", dom);
        assertTrue(list.getLength() > 1000);

        // setup limited list
        WCSInfo service = getGeoServer().getService(WCSInfo.class);
        service.getSRS().add("4326");
        service.getSRS().add("32632");
        getGeoServer().save(service);
       
        dom = getAsDOM("wcs?request=GetCapabilities&service=WCS");
        // print(dom);
        list = xpath.getMatchingNodes("//wcs:ServiceMetadata/wcs:Extension/wcscrs:crsSupported", dom);
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

public class WCSAdminPageTest extends GeoServerWicketCoverageTestSupport {

    @Test
    public void test() throws Exception {
        login();
        WCSInfo wcs = getGeoServerApplication().getGeoServer().getService(WCSInfo.class);
       
        // start the page
        tester.startPage(new WCSAdminPage());
       
        tester.assertRenderedPage(WCSAdminPage.class);
       
        // test that components have been filled as expected
        tester.assertComponent("form:keywords", KeywordsEditor.class);
        tester.assertModelValue("form:keywords", wcs.getKeywords());
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

    /**
     * @return The global wcs instance from the application context.
     */
    protected WCSInfo getWCS() {
        WCSInfo wcs = getGeoServer().getService(WCSInfo.class);
        return wcs;
    }
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

    }

    @Test
    public void getFullCoverageLatLon() throws Exception {
        // impose latlon retaining
        final WCSInfo wcsInfo = getWCS();
        final boolean oldLatLon=wcsInfo.isLatLon();
        wcsInfo.setLatLon(true);
        getGeoServer().save(wcsInfo);
       
        // execute
        MockHttpServletResponse response = getAsServletResponse("wcs?request=GetCoverage&service=WCS&version=2.0.1&coverageId=wcs__BlueMarble");
       
        assertEquals("image/tiff", response.getContentType());
        byte[] tiffContents = getBinary(response);
        File file = new File("./target/bm_full.tiff");
        FileUtils.writeByteArrayToFile(file, tiffContents);
       
        final Hints hints= new Hints();
        hints.put(Hints.FORCE_AXIS_ORDER_HONORING, "EPSG");
        hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.FALSE);
        GeoTiffReader readerTarget = new GeoTiffReader(file,hints);
        GridCoverage2D targetCoverage = null, sourceCoverage=null;
        try {
            targetCoverage = readerTarget.read(null);
            sourceCoverage=(GridCoverage2D) this.getCatalog().getCoverageByName("BlueMarble").getGridCoverageReader(null, null).read(null);
           
            // checks
            assertEquals(sourceCoverage.getGridGeometry().getGridRange(), targetCoverage.getGridGeometry().getGridRange());
            assertEquals(CRS.getAxisOrder(targetCoverage.getCoordinateReferenceSystem()),AxisOrder.NORTH_EAST);
           
            final GeneralEnvelope transformedEnvelope=CRS.transform((AffineTransform2D)CoverageUtilities.AXES_SWAP,targetCoverage.getEnvelope());
            transformedEnvelope.setCoordinateReferenceSystem(sourceCoverage.getCoordinateReferenceSystem());
            assertEquals(sourceCoverage.getEnvelope(), transformedEnvelope);
        } finally {
            // reinforce old settings
            wcsInfo.setLatLon(oldLatLon);
            getGeoServer().save(wcsInfo);
           
            try{
                readerTarget.dispose();
            } catch (Exception e) {
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

    }

    @Test
    public void getFullCoverageLonLat() throws Exception {
        // impose not using latLon retaining
        final WCSInfo wcsInfo = getWCS();
        final boolean oldLatLon = wcsInfo.isLatLon();
        wcsInfo.setLatLon(false);
        getGeoServer().save(wcsInfo);

        // execute
        MockHttpServletResponse response = getAsServletResponse("wcs?request=GetCoverage&service=WCS&version=2.0.1&coverageId=wcs__BlueMarble");

        assertEquals("image/tiff", response.getContentType());
        byte[] tiffContents = getBinary(response);
        File file = new File("./target/bm_fullLonLat.tiff");
        FileUtils.writeByteArrayToFile(file, tiffContents);

        final Hints hints = new Hints();
        hints.put(Hints.FORCE_AXIS_ORDER_HONORING, "EPSG");
        hints.put(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
        GeoTiffReader readerTarget = new GeoTiffReader(file, hints);
        GridCoverage2D targetCoverage = null, sourceCoverage = null;
        try {
            targetCoverage = readerTarget.read(null);
            sourceCoverage = (GridCoverage2D) this.getCatalog().getCoverageByName("BlueMarble")
                    .getGridCoverageReader(null, null).read(null);

            // checks
            assertEquals(sourceCoverage.getGridGeometry().getGridRange(), targetCoverage
                    .getGridGeometry().getGridRange());
            assertEquals(CRS.getAxisOrder(targetCoverage.getCoordinateReferenceSystem()),
                    AxisOrder.EAST_NORTH);

            assertEquals(sourceCoverage.getEnvelope(), targetCoverage.getEnvelope());
        } finally {
            // reinforce old settings
            wcsInfo.setLatLon(oldLatLon);
            getGeoServer().save(wcsInfo);

            try {
                readerTarget.dispose();
            } catch (Exception e) {
View Full Code Here

Examples of org.geoserver.wcs.WCSInfo

        // build the path where the clients will be able to retrieve the coverage files
        final String coverageLocation = buildURL(request.getBaseUrl(),
                appendPath("temp/wcs", coverageFile.getName()), null, URLType.RESOURCE);
       
        // build the response
        WCSInfo wcs = geoServer.getService(WCSInfo.class);
        CoveragesTransformer tx = new CoveragesTransformer(wcs, request, coverageLocation);
        try {
            tx.transform(coverageInfo, output);
        } catch (TransformerException e) {
            throw new WcsException("Failure trying to encode Coverages response", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.