Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageInfo


       
        login();
        FormTestPage page = new FormTestPage(new ComponentBuilder() {
       
            public Component buildComponent(String id) {
                CoverageInfo info = getCatalog().getResources(CoverageInfo.class).get(0);
                LayerInfo layer = getCatalog().getLayerByName(info.getName());
                return new WCSLayerConfig(id, new Model(layer));
            }
        });
       
        tester.startPage(page);
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

        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

            ri.setProjectionPolicy(ProjectionPolicy.FORCE_DECLARED);
        }
        if (model.getObject() instanceof CoverageInfo) {
            // coverages projection policy choice is not allowed, if there is a native a
            // reprojection will occurr
            CoverageInfo ci = (CoverageInfo) model.getObject();
            ci.setProjectionPolicy(ProjectionPolicy.REPROJECT_TO_DECLARED);
        }
        refForm.add(projectionPolicy);
       
       
        refForm.add(new ReprojectionIsPossibleValidator(nativeCRS, declaredCRS, projectionPolicy));
View Full Code Here

            try {
                if (layerInfo.getType() == Type.VECTOR) {
                    FeatureType featureType = mli.getFeature().getFeatureType();
                    request.setLayer(featureType);
                } else if (layerInfo.getType() == Type.RASTER) {
                    CoverageInfo coverageInfo = mli.getCoverage();

                    // it much safer to wrap a reader rather than a coverage in most cases, OOM can
                    // occur otherwise
                    final AbstractGridCoverage2DReader reader = (AbstractGridCoverage2DReader) coverageInfo
                            .getGridCoverageReader(new NullProgressListener(), GeoTools
                                    .getDefaultHints());
                    final FeatureCollection<SimpleFeatureType, SimpleFeature> feature = FeatureUtilities
                            .wrapGridCoverageReader(reader, null);
                    request.setLayer(feature.getSchema());
View Full Code Here

                      ReferencedEnvelope bounds;
            // 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, null);
                            bounds = new ReferencedEnvelope(reader.getOriginalEnvelope());
                            // apply the bounds, taking into account the reprojection policy if need be
                            if (resourceInfo.getProjectionPolicy() == ProjectionPolicy.REPROJECT_TO_DECLARED && bounds != null) {
                                try {
                                    bounds = bounds.transform(resourceInfo.getCRS(), true);
View Full Code Here

        assertTrue( catalog.getCoverages().isEmpty() );
       
        catalog.add( cv );
        assertEquals( 1, catalog.getCoverages().size() );
       
        CoverageInfo cv2 = catalog.getFactory().createCoverage();
        try {
            catalog.add(cv2);
            fail( "adding with no name should throw exception");
        }
        catch( Exception e ) {}
       
        cv2.setName("cv2Name");
        try {
            catalog.add(cv2);
            fail( "adding with no store should throw exception");
        }
        catch( Exception e ) {}
       
        cv2.setStore( cs );
        catalog.add( cv2 );
        assertEquals( 2, catalog.getCoverages().size() );

        CoverageInfo fromCatalog = catalog.getCoverageByName("cv2Name");
        assertNotNull(fromCatalog);
        //ensure the collection properties are set to NullObjects and not to null
        assertNotNull(fromCatalog.getParameters());
       
        CoverageInfo cv3 = catalog.getFactory().createCoverage();
        cv3.setName( "cv3Name");
        try {
            catalog.getCoverages().add( cv3 );
            fail( "adding directly should throw an exception");
        }
        catch( Exception e ) {}
View Full Code Here

        if (delegate == null)
            throw new WcsException("Could not find encoder for output format " + outputFormat);

        // grab the coverage info for Coverages document encoding
        final GridCoverage2D coverage = (GridCoverage2D) coverages[0];
        CoverageInfo coverageInfo = catalog.getCoverageByName(request.getIdentifier().getValue());

        // use javamail classes to actually encode the document
        try {
            // coverages xml structure (always set the headers after the data
            // handlers, setting
View Full Code Here

        coverageStore.setName("coverageStore2");
        coverageStore.setWorkspace(ws);

        catalog.add(coverageStore);

        CoverageInfo coverage = catalog.getFactory().createCoverage();
        coverage.setName("coverage");
        coverage.setNativeName("nativename");
        coverage.setTitle("coverage title");
        coverage.setDescription("coverage description");
        coverage.setAbstract("coverage abstract");
        coverage.setSRS("EPSG:4326");
        coverage.setNamespace(namespace);
        coverage.setStore(coverageStore);
        coverage
                .setNativeBoundingBox(new ReferencedEnvelope(0, 0, 0, 0, DefaultGeographicCRS.WGS84));
        coverage
                .setLatLonBoundingBox(new ReferencedEnvelope(0, 0, 0, 0, DefaultGeographicCRS.WGS84));

        coverage.setNativeFormat("nativeFormat");
        coverage.getSupportedFormats().add("supportedFormat1");
        coverage.getSupportedFormats().add("supportedFormat2");

        coverage.setDefaultInterpolationMethod("defaultInterpolationMethod");
        coverage.getInterpolationMethods().add("interpolationMethod1");
        coverage.getInterpolationMethods().add("interpolationMethod2");

        coverage.getRequestSRS().add("EPSG:3003");
        coverage.getRequestSRS().add("EPSG:4326");
        coverage.getResponseSRS().add("EPSG:42102");

        catalog.add(coverage);

        endTransaction();

        startNewTransaction();
        CoverageInfo coverage1 = catalog.getCoverage(coverage.getId());
        assertNotNull(coverage1);

        // assertFalse( coverage == coverage1 );
        coverage = ModificationProxy.unwrap(coverage1);
View Full Code Here

        coverageStore.setName(csname);
        coverageStore.setWorkspace(ws);

        catalog.add(coverageStore);

        CoverageInfo coverage = catalog.getFactory().createCoverage();
        coverage.setName(covname);
        coverage.setNativeName(covnname);
        coverage.setTitle(covtitle);
        coverage.setStore(coverageStore);
        // coverage.setNativeBoundingBox(new ReferencedEnvelope(0, 0, 0, 0,
        // DefaultGeographicCRS.WGS84));
        // coverage.setLatLonBoundingBox(new ReferencedEnvelope(0, 0, 0, 0,
        // DefaultGeographicCRS.WGS84));
        catalog.add(coverage);
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.