Package org.geotools.coverage.grid.io

Examples of org.geotools.coverage.grid.io.GridCoverage2DReader


     * all dimensions found.
     */
    private boolean enableDimensions(CoverageInfo ci, EoLayerType type) {
        boolean timeDimension = false;
        boolean customDimension = false;
        GridCoverage2DReader reader = null;
        try {
            // acquire a reader
            reader = (GridCoverage2DReader) ci.getGridCoverageReader(null, null);
            if (reader == null) {
                throw new RuntimeException("Unable to acquire reader for this coverageinfo: "
                        + ci.getName());
            }
            if(ci.getNativeCoverageName() != null) {
                reader = SingleGridCoverage2DReader.wrap(reader, ci.getNativeCoverageName());
            }

            // inspect dimensions
            final ReaderDimensionsAccessor ra = new ReaderDimensionsAccessor(reader);
            for (String domain : ra.getCustomDomains()) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    boolean hasRange = ra.hasRange(domain);
                    boolean hasResolution = ra.hasResolution(domain);
                    LOGGER.fine(ci.getName() + ": found " + domain + " dimension (hasRange: "
                            + hasRange + ", hasResolution: " + hasResolution + ")");
                }

                DimensionInfo dimension = new DimensionInfoImpl();
                dimension.setEnabled(true);
                dimension.setPresentation(DimensionPresentation.LIST);
                ci.getMetadata().put(ResourceInfo.CUSTOM_DIMENSION_PREFIX + domain, dimension);

                customDimension = true;
            }

            String elev = reader.getMetadataValue(GridCoverage2DReader.HAS_ELEVATION_DOMAIN);
            if (Boolean.parseBoolean(elev)) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine(ci.getName() + ": found ELEVATION dimension");
                }

                DimensionInfo dimension = new DimensionInfoImpl();
                dimension.setEnabled(true);
                dimension.setPresentation(DimensionPresentation.LIST);
                ci.getMetadata().put(ResourceInfo.ELEVATION, dimension);
            }

            String time = reader.getMetadataValue(GridCoverage2DReader.HAS_TIME_DOMAIN);
            if (Boolean.parseBoolean(time)) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.fine(ci.getName() + ": found TIME dimension");
                }

View Full Code Here


            return 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 GridCoverage2DReader reader;
            reader = (GridCoverage2DReader) coverageInfo.getGridCoverageReader(
                    new NullProgressListener(), GeoTools.getDefaultHints());
            final SimpleFeatureCollection feature;
            feature = FeatureUtilities.wrapGridCoverageReader(reader, null);
            return feature.getSchema();
View Full Code Here

            //
            // GRAB A READER
            //
            // grab the reader using the default params
            final GridCoverage2DReader reader = (GridCoverage2DReader) meta
                    .getGridCoverageReader(null, WCSUtils.getReaderHints(wcs));
            if (reader == null) {
                // cannot instantiate a reader, we should return an empty array
                return coverageResults.toArray(new GridCoverage2D[] {});
            }

            // get native elements and then play with the the requested ones
            final GeneralEnvelope nativeEnvelope = reader.getOriginalEnvelope();
            final CoordinateReferenceSystem nativeCRS = nativeEnvelope
                    .getCoordinateReferenceSystem();

            // get requested crs
            String requestedCRS = null;
            if (outputCRS != null) {
                requestedCRS = outputCRS.getValue();
            }

            // Compute the target crs, the crs that the final coverage will be served into
            final CoordinateReferenceSystem targetCRS;
            if (requestedCRS == null) {
                targetCRS = reader.getOriginalEnvelope().getCoordinateReferenceSystem();
                requestedCRS = CRS.lookupIdentifier(targetCRS, true);
            } else {
                // FORCE LON,LAT!!!!
                targetCRS = CRS.decode(requestedCRS, true);
            }
           
            //
            // PREPARE DESTINATION DIMENSIONS
            //
            final Rectangle destinationSize;
            final AffineTransform2D destinationG2W;
            final GridEnvelope limits = grid.getLimits();
            if (limits != null) {
                //
                // we have imposed limits from the request, we just use them as they are
                //
                final int[] lowers = limits.getLow().getCoordinateValues();
                destinationG2W = null;
                destinationSize = new Rectangle(lowers[0], lowers[1], limits.getSpan(0), limits
                        .getSpan(1));
            } else if (grid.getOffsetVector() != null && grid.getOffsetVector().size() > 0) {
                //
                // we have NO imposed limits from the request, we need to create a proper G2W with
                // the RESOLUTION we where given.
                // Notice that this is specific to WCS 1.0.0 since the request just allow us to
                // specify ResX and ResY
                //
                final VectorType offsetVector = (VectorType) grid.getOffsetVector().get(0);
                final List offsetValues = offsetVector.getValue();
                final double resX = (Double) offsetValues.get(0);
                final double resY = (Double) offsetValues.get(1);

                final DirectPositionType origin_ = grid.getOrigin().getPos();
                destinationSize = null;
                destinationG2W = new AffineTransform2D(resX, 0d, 0d, resY, (Double) origin_
                        .getValue().get(0), (Double) origin_.getValue().get(1));

            } else {
                throw new WcsException("Invalid Grid value:" + grid.toString(),
                        InvalidParameterValue, null);
            }

            //
            // SETTING COVERAGE READING PARAMS
            //
            // get the group of parameters tha this reader supports
            final ParameterValueGroup readParametersDescriptor = reader.getFormat()
                    .getReadParameters();
            GeneralParameterValue[] readParameters = CoverageUtils.getParameters(
                    readParametersDescriptor, meta.getParameters());
            readParameters = (readParameters != null ? readParameters
                    : new GeneralParameterValue[0]);

            // read grid geometry
            final GridGeometry2D requestedGridGeometry;
            if (destinationSize != null)
                // we have been asked to support a specific raster size, we will set the grid2world
                // accordingly
                requestedGridGeometry = new GridGeometry2D(new GridEnvelope2D(destinationSize),
                        getHorizontalEnvelope(requestedEnvelope));
            else
                // we have been asked to support a specific g2w, we will set the raster size
                // accordingly
                requestedGridGeometry = new GridGeometry2D(PixelInCell.CELL_CENTER, destinationG2W,
                        getHorizontalEnvelope(requestedEnvelope), null);
            // NOTICE that we always have to respect the provided envelope
            final ParameterValue<GeneralGridGeometry> requestedGridGeometryParam = new DefaultParameterDescriptor<GeneralGridGeometry>(
                    AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(),
                    GeneralGridGeometry.class, null, requestedGridGeometry).createValue();
            GeneralParameterValue[] tmpArray = new GeneralParameterValue[readParameters.length+1];
            System.arraycopy(readParameters, 0, tmpArray, 0, readParameters.length);
            tmpArray[tmpArray.length-1]=requestedGridGeometryParam;
            readParameters=tmpArray;
           
           
            /*
             * Test if the parameter "TIME" is present in the WMS request, and by the way in the
             * reading parameters. If it is the case, one can adds it to the request. If an
             * exception is thrown, we have nothing to do.
             */
            final List<GeneralParameterDescriptor> parameterDescriptors = new ArrayList<GeneralParameterDescriptor>(
                    readParametersDescriptor.getDescriptor().descriptors());
            Set<ParameterDescriptor<List>> dynamicParameters = reader.getDynamicParameters();
            parameterDescriptors.addAll(dynamicParameters);

            //
            // TIME
            //
            ReaderDimensionsAccessor dimensions = new ReaderDimensionsAccessor(reader);
            DimensionInfo timeDimension = meta.getMetadata().get(ResourceInfo.TIME, DimensionInfo.class);
            if(timeDimension != null && timeDimension.isEnabled() && dimensions.hasTime()) {
                final List<Object> timeValues = new ArrayList<Object>();
                if (temporalSubset != null && temporalSubset.getTimePosition() != null) {
                    // grab the time positions
                    final EList timePosition = temporalSubset.getTimePosition();
                    for (Iterator it = timePosition.iterator(); it.hasNext();) {
                        TimePositionType tp = (TimePositionType) it.next();
                        Date date = (Date) tp.getValue();
                        if(date == null) {
                            date = dimensions.getMaxTime();
                        }
                        timeValues.add(date);
                    }
                    // grab the time intervals
                    final EList timePeriods = temporalSubset.getTimePeriod();
                    for (Iterator it = timePeriods.iterator(); it.hasNext();) {
                        TimePeriodType tp = (TimePeriodType) it.next();
                        Date begin = (Date) tp.getBeginPosition().getValue();
                        Date end = (Date) tp.getEndPosition().getValue();
                        timeValues.add(new DateRange(begin, end));
                    }
                }
               
                if(timeValues.isEmpty()) {
                    Date date = dimensions.getMaxTime();
                    timeValues.add(date);
                }
               
                readParameters = CoverageUtils.mergeParameter(parameterDescriptors,
                        readParameters, timeValues, "TIME", "Time");
            }
           
            //
            // ELEVATION SUPPORT VIA A SPECIFIC AXIS ELEVATION
            //
            DimensionInfo elevationDimension = meta.getMetadata().get(ResourceInfo.ELEVATION, DimensionInfo.class);
            if(elevationDimension != null && elevationDimension.isEnabled() && dimensions.hasElevation()) {
                List<Double> elevations = new ArrayList<Double>();
                // extract elevation values
                List axisSubset = null;
                if (request.getRangeSubset() != null) {
                    axisSubset = request.getRangeSubset().getAxisSubset();
                    if (axisSubset.size() > 0) {
                        for (int a = 0; a < axisSubset.size(); a++) {
                            AxisSubsetType axis = (AxisSubsetType) axisSubset.get(a);

                            String axisName = axis.getName();
                            if (axisName.equalsIgnoreCase(WCSUtils.ELEVATION)) {
                                if (axis.getSingleValue().size() > 0) {
                                    for (int s = 0; s < axis.getSingleValue().size(); s++) {
                                        elevations.add(Double.parseDouble(((TypedLiteralType) axis
                                                .getSingleValue().get(s)).getValue()));
                                    }
                                } else if (axis.getInterval().size() > 0) {
                                    IntervalType interval = (IntervalType) axis.getInterval().get(0);
                                    int min = Integer.parseInt(interval.getMin().getValue());
                                    int max = Integer.parseInt(interval.getMax().getValue());
                                    int res = (interval.getRes() != null ? Integer.parseInt(interval
                                            .getRes().getValue()) : 1);

                                    int count = (int) (Math.floor(max - min) / res + 1);
                                    for (int b = 0; b < count; b++) {
                                        elevations.add(new Double(min + b * res));
                                    }
                                }
                            }
                        }
                    }
                }
               
                if(elevations.isEmpty()) {
                    elevations.add(dimensions.getMinElevation());
                }
               
                readParameters = CoverageUtils.mergeParameter(parameterDescriptors,
                        readParameters, elevations, "ELEVATION", "Elevation");
            }
           
            //
            // CUSTOM DIMENSION SUPPORT
            //
            if (request.getRangeSubset() != null) {
                EList<?> axisSubset = request.getRangeSubset().getAxisSubset();
                final int asCount = axisSubset == null ? 0 : axisSubset.size();
                for (int i = 0; i < asCount; i++) {
                    AxisSubsetType axis = (AxisSubsetType)axisSubset.get(i);
                    String axisName = axis.getName();
                    if (!axisName.equalsIgnoreCase(WCSUtils.ELEVATION)) {
                        Object dimInfo = meta.getMetadata().get(ResourceInfo.CUSTOM_DIMENSION_PREFIX + axisName);
                        axisName = axisName.toUpperCase(); // using uppercase with imagemosaic
                        if (dimInfo instanceof DimensionInfo && dimensions.hasDomain(axisName)) {
                            int valueCount = axis.getSingleValue().size();
                            if (valueCount > 0) {
                                List<String> dimValues = new ArrayList<String>(valueCount);
                                for (int s = 0; s < valueCount; s++) {
                                    dimValues.add(((TypedLiteralType) axis
                                            .getSingleValue().get(s)).getValue());
                                }
                                readParameters = CoverageUtils.mergeParameter(parameterDescriptors,
                                        readParameters, dimValues, axisName);
                            }
                        }
                    }
                }   
            }
           
            //
            // Check if we have a filter among the params
            //
            Filter filter = WCSUtils.getRequestFilter();
            if(filter != null) {
                readParameters = CoverageUtils.mergeParameter(parameterDescriptors,
                        readParameters, filter, "FILTER", "Filter");
            }
           
            // Check we're not going to read too much data
            WCSUtils.checkInputLimits(wcs, meta, reader, requestedGridGeometry);


            //
            // Checking for supported Interpolation Methods
            //
            Interpolation interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);

            String interpolationType = null;
            if(request.getInterpolationMethod()!=null){
                interpolationType = request.getInterpolationMethod().getLiteral();           
                if (interpolationType != null) {
                  
                    if (interpolationType.equalsIgnoreCase("bilinear")) {
                        interpolation = Interpolation.getInstance(Interpolation.INTERP_BILINEAR);
                    } else if (interpolationType.equalsIgnoreCase("bicubic")) {
                        interpolation = Interpolation.getInstance(Interpolation.INTERP_BICUBIC);
                    } else if (interpolationType.equalsIgnoreCase("nearest neighbor")) {
                        interpolation = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
                    }
                    readParameters = CoverageUtils.mergeParameter(parameterDescriptors,readParameters, interpolation, "interpolation");
                    if(meta.getStore().getFormat() instanceof ImageMosaicFormat){
                        GeneralParameterValue[] temp = new GeneralParameterValue[readParameters.length+1];
                        System.arraycopy(readParameters, 0, temp, 0, readParameters.length);
                        temp[temp.length-1]=ImageMosaicFormat.INTERPOLATION.createValue();
                        ((ParameterValue)temp[temp.length-1]).setValue(interpolation);
                        readParameters=temp;
                    }
                }
            }
            //
            // make sure we work in streaming mode
            //
            // work in streaming fashion when JAI is involved
            readParameters = WCSUtils.replaceParameter(readParameters, Boolean.FALSE,
                    AbstractGridFormat.USE_JAI_IMAGEREAD);
           
            //
            // perform read
            //
            coverage = (GridCoverage2D) reader.read(readParameters);
            if ((coverage == null) || !(coverage instanceof GridCoverage2D)) {
                throw new IOException("No raster data found in the request (it may be that " +
                    "the request bbox is outside of the coverage area, or that the filters used " +
                    "match no portions of it.");
            }
View Full Code Here

    public List<FeatureCollection> identify(FeatureInfoRequestParameters params, int maxFeatures) throws Exception {
        final MapLayerInfo layer = params.getLayer();
        final Filter filter = params.getFilter();
        final CoverageInfo cinfo = layer.getCoverage();
        final GridCoverage2DReader reader = (GridCoverage2DReader) cinfo
                .getGridCoverageReader(new NullProgressListener(),
                        GeoTools.getDefaultHints());
       
       
        // set the requested position in model space for this request
        final Coordinate middle = WMS.pixelToWorld(params.getX(), params.getY(), params.getRequestedBounds(), params.getWidth(), params.getHeight());
        CoordinateReferenceSystem requestedCRS = params.getRequestedCRS();
        DirectPosition position = new DirectPosition2D(requestedCRS, middle.x, middle.y);

        // change from request crs to coverage crs in order to compute a minimal request
        // area,
        // TODO this code need to be made much more robust
        if (requestedCRS != null) {
            final CoordinateReferenceSystem targetCRS;
            if(cinfo.getProjectionPolicy() == ProjectionPolicy.NONE) {
                targetCRS = cinfo.getNativeCRS();
            } else {
                targetCRS = cinfo.getCRS();
            }
            final TransformedDirectPosition arbitraryToInternal = new TransformedDirectPosition(
                    requestedCRS, targetCRS, new Hints(Hints.LENIENT_DATUM_SHIFT,
                            Boolean.TRUE));
            try {
                arbitraryToInternal.transform(position);
            } catch (TransformException exception) {
                throw new CannotEvaluateException("Unable to answer the geatfeatureinfo",
                        exception);
            }
            position = arbitraryToInternal;
        }
        // check that the provided point is inside the bbox for this coverage
        if (!reader.getOriginalEnvelope().contains(position)) {
            return null;
        }

        // read from the request
        GetMapRequest getMap = params.getGetMapRequest();
        GeneralParameterValue[] parameters = wms.getWMSReadParameters(getMap,
                layer, filter, params.getTimes(), params.getElevations(), reader, true);
       
       
        // now get the position in raster space using the world to grid related to
        // corner
        final MathTransform worldToGrid = reader.getOriginalGridToWorld(PixelInCell.CELL_CORNER)
                .inverse();
        final DirectPosition rasterMid = worldToGrid.transform(position, null);
        // create a 20X20 rectangle aruond the mid point and then intersect with the
        // original range
        final Rectangle2D.Double rasterArea = new Rectangle2D.Double();
        rasterArea.setFrameFromCenter(rasterMid.getOrdinate(0), rasterMid.getOrdinate(1),
                rasterMid.getOrdinate(0) + 10, rasterMid.getOrdinate(1) + 10);
        final Rectangle integerRasterArea = rasterArea.getBounds();
        final GridEnvelope gridEnvelope = reader.getOriginalGridRange();
        final Rectangle originalArea = (gridEnvelope instanceof GridEnvelope2D) ? (GridEnvelope2D) gridEnvelope
                : new Rectangle();
        XRectangle2D.intersect(integerRasterArea, originalArea, integerRasterArea);
        // paranoiac check, did we fall outside the coverage raster area? This should
        // never really happne if the request is well formed.
        if (integerRasterArea.isEmpty()) {
            return null;
        }
        // now set the grid geometry for this request
        for (int k = 0; k < parameters.length; k++) {
            if (!(parameters[k] instanceof Parameter<?>))
                continue;

            final Parameter<?> parameter = (Parameter<?>) parameters[k];
            if (parameter.getDescriptor().getName()
                    .equals(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName())) {
                //
                // create a suitable geometry for this request reusing the getmap (we
                // could probably optimize)
                //
                parameter.setValue(new GridGeometry2D(new GridEnvelope2D(integerRasterArea), reader
                        .getOriginalGridToWorld(PixelInCell.CELL_CENTER), reader.getCoordinateReferenceSystem()));
            }

        }

        final GridCoverage2D coverage = (GridCoverage2D) reader.read(parameters);
        if (coverage == null) {
            if (LOGGER.isLoggable(Level.FINE))
                LOGGER.fine("Unable to load raster data for this request.");
            return null;
        }
View Full Code Here

            // get a reader for this CoverageInfo
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Getting reader for the coverage");
            }
            final GridCoverage2DReader reader = (GridCoverage2DReader) coverageInfo
                    .getGridCoverageReader(null, null);
            final ParameterValueGroup readParametersDescriptor = reader.getFormat()
                    .getReadParameters();
            final List<GeneralParameterDescriptor> parameterDescriptors = readParametersDescriptor
                    .getDescriptor().descriptors();
            // get the configured metadata for this coverage without
            GeneralParameterValue[] readParameters = CoverageUtils.getParameters(
                    readParametersDescriptor, coverageInfo.getParameters(), false);

            // merge support for filter
            if (filter != null) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE, "Add the filter");
                }
                readParameters = CoverageUtils.mergeParameter(parameterDescriptors, readParameters,
                        filter, "FILTER", "Filter");
            }
            // read GridGeometry preparation
            if (roi != null) {
                // set crs in roi manager
                roiManager.useNativeCRS(reader.getCoordinateReferenceSystem());
                roiManager.useTargetCRS(targetCRS);
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                            "Preparing the GridGeometry for cropping input layer with ROI");
                }
                // create GridGeometry
                final ReferencedEnvelope roiEnvelope = new ReferencedEnvelope(roiManager
                        .getSafeRoiInNativeCRS().getEnvelopeInternal(), // safe envelope
                        nativeCRS);
                GridGeometry2D gg2D = new GridGeometry2D(PixelInCell.CELL_CENTER,
                        reader.getOriginalGridToWorld(PixelInCell.CELL_CENTER), roiEnvelope,
                        GeoTools.getDefaultHints());
                // TODO make sure the GridRange is not empty, depending on the resolution it might happen
                readParameters = CoverageUtils.mergeParameter(parameterDescriptors, readParameters,
                        gg2D, AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().getCode());
            }
            // make sure we work in streaming fashion
            readParameters = CoverageUtils.mergeParameter(parameterDescriptors, readParameters,
                    Boolean.TRUE, AbstractGridFormat.USE_JAI_IMAGEREAD.getName().getCode());

            // --> READ
            originalGridCoverage = (GridCoverage2D) reader.read(readParameters);

            //
            // STEP 1 - Reproject if needed
            //
            if (reproject) {
View Full Code Here

            // set use nativeCRS
            roiManager.useNativeCRS(nativeCRS);
        }

        // get a reader for this CoverageInfo
        final GridCoverage2DReader reader = (GridCoverage2DReader) coverageInfo
                .getGridCoverageReader(null, null);

        // Area to read in pixel
        final double areaRead;
        // If ROI is present, then the coverage BBOX is cropped with the ROI geometry
        if (roi != null) {
            if (LOGGER.isLoggable(Level.FINE)) {
                LOGGER.log(Level.FINE, "Reprojecting ROI");
            }
            final Geometry safeRoiInNativeCRS = roiManager.getSafeRoiInNativeCRS();
            Geometry roiInNativeCRS_ = safeRoiInNativeCRS.intersection(FeatureUtilities.getPolygon(
                    reader.getOriginalEnvelope(), new GeometryFactory(new PrecisionModel(
                            PrecisionModel.FLOATING))));
            if (roiInNativeCRS_.isEmpty()) {
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE,
                            "Empty intersection, so the result does not exceed the limits");
                }
                return true; // EMPTY Intersection
            }
            // world to grid transform
            final AffineTransform2D w2G = (AffineTransform2D) reader.getOriginalGridToWorld(
                    PixelInCell.CELL_CORNER).inverse();
            final Geometry rasterGeometry = JTS.transform(roiInNativeCRS_, w2G);

            // try to make an estimate of the area we need to read
            // NOTE I use the envelope since in the end I can only pass down
            // a rectangular source region to the ImageIO-Ext reader, but in the end I am only going
            // to read the tile I will need during processing as in this case I am going to perform
            // deferred reads
            areaRead = rasterGeometry.getEnvelope().getArea();
            // TODO investigate on improved precision taking into account tiling on raster geometry

        } else {
            // No ROI, we are trying to read the entire coverage
            final Rectangle2D originalGridRange = (GridEnvelope2D) reader.getOriginalGridRange();
            areaRead = originalGridRange.getWidth() * originalGridRange.getHeight();

        }
        // checks on the area we want to download
        if (LOGGER.isLoggable(Level.FINE)) {
View Full Code Here

               
                if(csinfo == null) {
                    throw new WcsException("Unable to acquire coverage store resource for coverage: " + cv.getName());
                }
               
                GridCoverage2DReader reader = null;
                try {
                    reader = (GridCoverage2DReader) cv.getGridCoverageReader(null, GeoTools.getDefaultHints());
                } catch (IOException e) {
                    LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
                }
View Full Code Here

                // 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;
                    GridCoverage2DReader reader = (GridCoverage2DReader) 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();
View Full Code Here

            CoverageStoreInfo csinfo = ci.getStore();
           
            if(csinfo == null)
                throw new WcsException("Unable to acquire coverage store resource for coverage: " + ci.getName());
           
            GridCoverage2DReader reader = null;
            try {
                reader = (GridCoverage2DReader) ci.getGridCoverageReader(null, GeoTools.getDefaultHints());
            } catch (IOException e) {
                LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
            }
View Full Code Here

            CoverageStoreInfo csinfo = ci.getStore();
           
            if(csinfo == null)
                throw new WcsException("Unable to acquire coverage store resource for coverage: " + ci.getName());
           
            GridCoverage2DReader reader = null;
            try {
                reader = (GridCoverage2DReader) ci.getGridCoverageReader(null, GeoTools.getDefaultHints());
            } catch (IOException e) {
                LOGGER.severe("Unable to acquire a reader for this coverage with format: " + csinfo.getFormat().getName());
            }
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.io.GridCoverage2DReader

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.