Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageInfo


        if (layer == null || layer.getType() != LayerInfo.Type.RASTER) {
                    throw new WcsException("Could not find the specified coverage: "
                            + coverageId, WcsExceptionCode.InvalidParameterValue, "identifiers");
                }

                CoverageInfo ci = catalog.getCoverageByName(coverageId);
                try {
                    handleCoverageDescription(ci);
                } catch (Exception e) {
                    throw new RuntimeException(
                            "Unexpected error occurred during describe coverage xml encoding", e);
View Full Code Here


        }
        if ( !super.equals( obj ) ) {
            return false;
        }
       
        final CoverageInfo other = (CoverageInfo) obj;
        if (defaultInterpolationMethod == null) {
            if (other.getDefaultInterpolationMethod() != null)
                return false;
        } else if (!defaultInterpolationMethod
                .equals(other.getDefaultInterpolationMethod()))
            return false;
        if (dimensions == null) {
            if (other.getDimensions() != null)
                return false;
        } else if (!dimensions.equals(other.getDimensions()))
            return false;
        if (grid == null) {
            if (other.getGrid() != null)
                return false;
        } else if (!grid.equals(other.getGrid()))
            return false;
        if (interpolationMethods == null) {
            if (other.getInterpolationMethods() != null)
                return false;
        } else if (!interpolationMethods.equals(other.getInterpolationMethods()))
            return false;
        if (nativeFormat == null) {
            if (other.getNativeFormat() != null)
                return false;
        } else if (!nativeFormat.equals(other.getNativeFormat()))
            return false;
        if (parameters == null) {
            if (other.getParameters() != null)
                return false;
        } else if (!parameters.equals(other.getParameters()))
            return false;
        if (requestSRS == null) {
            if (other.getRequestSRS() != null)
                return false;
        } else if (!requestSRS.equals(other.getRequestSRS()))
            return false;
        if (responseSRS == null) {
            if (other.getResponseSRS() != null)
                return false;
        } else if (!responseSRS.equals(other.getResponseSRS()))
            return false;
        if (supportedFormats == null) {
            if (other.getSupportedFormats() != null)
                return false;
        } else if (!supportedFormats.equals(other.getSupportedFormats()))
            return false;
        return true;
    }
View Full Code Here

        // populate the access manager
        TestResourceAccessManager tam = (TestResourceAccessManager) applicationContext
                .getBean("testResourceAccessManager");
        Catalog catalog = getCatalog();
        CoverageInfo world = catalog.getCoverageByName(getLayerId(MockData.WORLD));

        // limits for mr cite_noworld: can't access the world layer
        tam.putLimits("cite_noworld", world, new CoverageAccessLimits(CatalogMode.HIDE,
                Filter.EXCLUDE, null, null));
View Full Code Here

            dao.getStoreByName(dao.getWorkspaceByName("acme"), "widgets", CoverageStoreInfo.class );
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
       
        assertNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
       
        CoverageInfo ft = dao.getCatalog().getFactory().createCoverage();
        ft.setName("anvil");
        ft.setNativeName("anvil");
        ft.setStore(ds);
        ft.setNamespace(ns);
       
        dao.add(ft);
       
        assertNotNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
    }
View Full Code Here

    @Test
    public void testModifyCoverage() throws Exception {
        testAddCoverage();
       
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        CoverageInfo ft = dao.getResourceByName(ns, "anvil", CoverageInfo.class);
       
        ft.setName("dynamite");
        dao.save(ft);
       
        assertNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
        assertNotNull(dao.getResourceByName(ns, "dynamite", CoverageInfo.class));
    }
View Full Code Here

    @Test
    public void testRemoveCoverage() throws Exception {
        testAddCoverage();
       
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        CoverageInfo ft = dao.getResourceByName(ns, "anvil", CoverageInfo.class);
       
        dao.remove(ft);
        assertNull(dao.getResourceByName(ns, "anvil", CoverageInfo.class));
    }
View Full Code Here

        // try to build from coverage store or data store
        try {
            CatalogBuilder builder = new CatalogBuilder(catalog);
            builder.setStore(store);
            if (store instanceof CoverageStoreInfo) {
                CoverageInfo ci = builder.buildCoverage();
                return builder.buildLayer(ci);
            } else if (store instanceof DataStoreInfo) {
                FeatureTypeInfo fti = builder.buildFeatureType(resource.getName());
                return builder.buildLayer(fti);
            } else if (store instanceof WMSStoreInfo) {
View Full Code Here

                    if (isNew) {
      // updating grid if is a coverage
                      if(resourceInfo instanceof CoverageInfo) {
                            // the coverage bounds computation path is a bit more linear, the
                            // readers always return the bounds and in the proper CRS (afaik)
                            CoverageInfo cinfo = (CoverageInfo) resourceInfo;    
                            AbstractGridCoverage2DReader reader = (AbstractGridCoverage2DReader) cinfo.getGridCoverageReader(null, GeoTools.getDefaultHints());

                            // get  bounds
                            final ReferencedEnvelope bounds = new ReferencedEnvelope(reader.getOriginalEnvelope());
                            // apply the bounds, taking into account the reprojection policy if need be
                            final ProjectionPolicy projectionPolicy=resourceInfo.getProjectionPolicy();
                            if (projectionPolicy != ProjectionPolicy.NONE && bounds != null) {
                                // we need to fix the registered grid for this coverage
                                final GridGeometry grid = cinfo.getGrid();
                                cinfo.setGrid(new GridGeometry2D(grid.getGridRange(),grid.getGridToCRS(), resourceInfo.getCRS()));
                            }
                        }
                     
                        catalog.add(resourceInfo);
                        try {
View Full Code Here

     * Sets the coverage info
     * @deprecated use {@link #setCoverage(CoverageInfo)}
     */
    public void setCoverageName(String coverageName){
        this.coverageName = coverageName;
        CoverageInfo c = catalog.getCoverageByName( coverageName );
        if ( c == null ) {
            return;
            //throw new IllegalArgumentException("No coverage named " + coverageName + " in catalog");
        }
        setCoverage(c);
View Full Code Here

    fi.close();
  }

  private GridCoverage2D extractCoverageSubset() throws IOException {
    // get the coverage
    CoverageInfo dem = getCatalog().getCoverageByName(DEM.getLocalPart());
    GridCoverage2D gc = (GridCoverage2D) dem.getGridCoverage(null,
        GeoTools.getDefaultHints());

    // extract only a small part of it
    Envelope fullEnvelope = gc.getEnvelope();
    GeneralEnvelope subset = new GeneralEnvelope(
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.CoverageInfo

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.