Package org.geoserver.catalog

Examples of org.geoserver.catalog.CoverageInfo


    public GridCoverageReader getCoverageReader() throws IOException {
        if (type != TYPE_RASTER) {
            throw new IllegalArgumentException("Layer type is not raster");
        }

        CoverageInfo resource = (CoverageInfo) layerInfo.getResource();
        GridCoverageReader coverageReader = resource.getGridCoverageReader(null, null);
        return coverageReader;
    }
View Full Code Here


            FeatureTypeInfo data = factory.createFeatureType();
            builder.updateFeatureType(data, resource);
            l.setResource(data);
        }
        else if (origResource instanceof CoverageInfo){
            CoverageInfo resource = (CoverageInfo) origResource;
            CoverageInfo data = factory.createCoverage();
            builder.updateCoverage( data,  resource);
            l.setResource(data);
        }
        else if (origResource instanceof WMSLayerInfo){
            WMSLayerInfo resource = (WMSLayerInfo) origResource;
View Full Code Here

        }
        else if (store instanceof CoverageStoreInfo) {
            CoverageStoreInfo covStore = (CoverageStoreInfo) store;
            builder.setStore(covStore);

            CoverageInfo cov = null;
            try {
                cov = builder.buildCoverage(resourceName.getLocalPart());
            } catch (Exception e) {
                Throwables.propagateIfInstanceOf(e, IOException.class);
                Throwables.propagate(e);
View Full Code Here

                    IO.schema(json.putObject("schema"), data.getFeatureType(),false);
                } catch (IOException e) {
                }
            }
           else if (info instanceof CoverageInfo ){
               CoverageInfo data = (CoverageInfo) info;
               IO.schemaGrid(json.putObject("schema"),data,false);
           }
        }
        return json;
    }
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;
                    reader = (AbstractGridCoverage2DReader) coverageInfo.getGridCoverageReader(
                            new NullProgressListener(), GeoTools.getDefaultHints());
                    final SimpleFeatureCollection feature;
                    feature = FeatureUtilities.wrapGridCoverageReader(reader, null);
                    request.setLayer(feature.getSchema());
                }
View Full Code Here

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

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

    LayerInfo layerInfo = catalog.getLayerByName(layer);
    if (layerInfo != null) {
      ResourceInfo obj = layerInfo.getResource();
      /* Check if it's feature type or coverage */
      if (obj instanceof CoverageInfo) {
        CoverageInfo cvInfo;
        cvInfo = (CoverageInfo) obj;
       
        StyleInfo defaultStyle = layerInfo.getDefaultStyle();
        RasterSymbolizer rasterSymbolizer = getRasterSymbolizer(defaultStyle);
       
View Full Code Here

           
            // filter out disabled coverages
            for (Iterator it = coverages.iterator(); it.hasNext();) {
                // GR: I don't think we should be removing directly from the list returned by
                // Catalog?
                CoverageInfo cv = (CoverageInfo) it.next();
                if(!cv.enabled())
                    it.remove();
            }
           
            // filter out coverages that are not in the requested namespace
            if(request.getNamespace() != null) {
                String namespace = request.getNamespace();
                for (Iterator it = coverages.iterator(); it.hasNext();) {
                    CoverageInfo cv = (CoverageInfo) it.next();
                    if(!namespace.equals(cv.getStore().getWorkspace().getName()))
                        it.remove();
                }
            }
           
            Collections.sort(coverages, new CoverageInfoLabelComparator());
            for (Iterator i = coverages.iterator(); i.hasNext();) {
                CoverageInfo cv = (CoverageInfo) i.next();
                if (cv.enabled())
                    handleCoverageSummary(cv);
            }

            end("wcs:Contents");
        }
View Full Code Here

                if (!(o instanceof CoverageInfo)) {
                    throw new IllegalArgumentException(new StringBuffer(
                            "Not a GetCapabilitiesType: ").append(o).toString());
                }

                CoverageInfo info = (CoverageInfo) o;

                final AttributesImpl attributes = new AttributesImpl();
                attributes.addAttribute("", "xmlns:wcs", "xmlns:wcs", "", WCS_URI);

                attributes.addAttribute("", "xmlns:xlink", "xmlns:xlink", "",
View Full Code Here

        private void handleDimensions(final LayerInfo layer) {
            String timeMetadataExtent = null;
            String elevationMetadataExtent = null;
            if (layer.getType() == Type.RASTER) {
                CoverageInfo cvinfo = ((CoverageInfo) layer.getResource());

                if (cvinfo == null)
                    throw new RuntimeException("Unable to acquire coverage resource for layer: "
                            + layer.getName());

                Catalog catalog = cvinfo.getCatalog();

                if (catalog == null)
                    throw new RuntimeException("Unable to acquire catalog resource for layer: "
                            + layer.getName());

                CoverageStoreInfo csinfo = cvinfo.getStore();

                if (csinfo == null)
                    throw new RuntimeException(
                            "Unable to acquire coverage store resource for layer: "
                                    + layer.getName());
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.