Package org.opengis.coverage.grid

Examples of org.opengis.coverage.grid.GridCoverageReader


        CoverageInfo ci = catalog.getCoverageByName(name);
        if (ci == null) {
            throw new WPSException("Could not find coverage " + name);
        }

        GridCoverageReader reader = ci.getGridCoverageReader(null, null);
        final ParameterValueGroup readParametersDescriptor = reader.getFormat().getReadParameters();
        final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor
                .getDescriptor().descriptors();
        GeneralParameterValue[] params = new GeneralParameterValue[0];
        if (filter != null) {
            params = CoverageUtils.mergeParameter(parameterDescriptors, params, filter, "FILTER",
                    "Filter");
        }

        return (GridCoverage2D) reader.read(params);
    }
View Full Code Here


        String coveragestore = getAttribute( "coveragestore");
        String coverage = getAttribute( "coverage" );

        LOGGER.fine( "GET coverage " + coveragestore + "," + coverage );
        final CoverageStoreInfo cs = catalog.getCoverageStoreByName(workspace, coveragestore);
        final GridCoverageReader reader = cs.getGridCoverageReader(null, null);
        final String[] coverageNames = reader.getGridCoverageNames();
        final List<String> coverages = new ArrayList<String>();
        for (String name: coverageNames) {
            coverages.add(name);
        }
        return coverages;
View Full Code Here

            throw new RestletException( "No such coverage: " + c + " in store " + ws + "/" + cs, Status.CLIENT_ERROR_NOT_FOUND );
        }
       
        // is it a structured grid coverage reader?
        try {
            GridCoverageReader reader = coverage.getGridCoverageReader(null, null);
            if(!(reader instanceof StructuredGridCoverage2DReader)) {
                throw new RestletException( "Coverage exists, but is no structured grid coverage, no index and inner granules are available", Status.CLIENT_ERROR_NOT_FOUND);
            }
           
            // fine, let's see what kind of resource we are looking for
View Full Code Here

        final ReferencedEnvelope bbox = coverageInfo.getLatLonBoundingBox();
        final GridCoverage coverage = resPool.getGridCoverage(coverageInfo, "waterView", bbox, null);
        assertEquals(coverage.getNumSampleDimensions(), 1);

        ((GridCoverage2D) coverage).dispose(true);
        final GridCoverageReader reader = resPool.getGridCoverageReader(coverageInfo, null);
        reader.dispose();
    }
View Full Code Here

    /*
    final ParameterValueGroup writerParams = format.getWriteParameters();
        writerParams.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString())
                    .setValue(wp);
    */
    GridCoverageReader coverageReader = mapLayerInfo.getCoverageReader();
   
    /*
     * Try to use a gridcoverage style render
     */
    GridCoverage2D subCov = null;
View Full Code Here

                        "No grid format found capable of connecting to the provided URL."
                                + " To save the store disable it, and check the required libraries are in place");
            }
            try {
                // get the reader through ResourcePool so it resolves relative URL's for us
                GridCoverageReader reader = resourcePool.getGridCoverageReader(info, GeoTools.getDefaultHints());
                LOGGER.info("Connection to store " + info.getName() + " validated. Got a "
                        + reader.getClass().getName() + ". Saving store");
                doSaveStore(info);
                doReturn(StorePage.class);
            } catch (IOException e) {
                confirmSaveOnConnectionFailure(info, requestTarget, e);
            } catch (RuntimeException e) {
View Full Code Here

    protected void updateCoveragesList(boolean reportSkippedLayers) {
        selections.clear();
        if (stores.getModelObject() != null) {
            try {
                CoverageStoreInfo store = (CoverageStoreInfo) stores.getModelObject();
                GridCoverageReader reader = store.getGridCoverageReader(null, null);
                String[] names = reader.getGridCoverageNames();
                Arrays.sort(names);
                for (String name : names) {
                    LayerInfo li = getPreExistingLayer(name, store);
                    if(li == null) {
                        selections.add(new EoCoverageSelection(name, EoLayerType.IGNORE));
View Full Code Here

        if(gridFormat == null) {
            throw new IOException("Could not find the raster plugin for format " + info.getType());
        }
       
        // look into the cache
        GridCoverageReader reader = null;
        Object key;
        if ( hints != null && info.getId() != null) {
            // expand the hints if necessary
            final String formatName = gridFormat.getName();
            if (formatName.equalsIgnoreCase(IMAGE_MOSAIC) || formatName.equalsIgnoreCase(IMAGE_PYRAMID)){
View Full Code Here

     *
     * @throws IOException Any errors that occur loading the coverage.
     */
    @SuppressWarnings("deprecation")
    public GridCoverage getGridCoverage( CoverageInfo info, String coverageName, ReferencedEnvelope env, Hints hints) throws IOException {
        final GridCoverageReader reader = getGridCoverageReader(info, coverageName, hints);
        if(reader == null) {
            return null;
        }
       
        return getGridCoverage(info, reader, env, hints);
View Full Code Here

                }
               
            } else if(store instanceof CoverageStoreInfo) {
                CoverageStoreInfo cstore = (CoverageStoreInfo) store;
                NamespaceInfo ns = getCatalog().getNamespaceByPrefix(cstore.getWorkspace().getName());
                GridCoverageReader reader = cstore.getGridCoverageReader(null, null);
                try {
                    String[] names = reader.getGridCoverageNames();
                    for (String name : names) {
                        Name qualified = new NameImpl(ns.getURI(), name);
                        Resource resource = new Resource(qualified);
                        resource.setMultiCoverageReader(true);
                        resources.put(name, resource);
View Full Code Here

TOP

Related Classes of org.opengis.coverage.grid.GridCoverageReader

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.