Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridCoverage2D.view()


            // JGrassRegion drawMapRegion = new JGrassRegion(drawMapRectangle.getMinX(),
            // drawMapRectangle.getMaxX(), drawMapRectangle.getMinY(), drawMapRectangle
            // .getMaxY(), ewRes, nsRes);
            JGrassMapEnvironment grassMapEnvironment = grassMapGeoResource.getjGrassMapEnvironment();
            GridCoverage2D coverage = JGrassCatalogUtilities.getGridcoverageFromGrassraster(grassMapEnvironment, drawMapRegion);
            coverage = coverage.view(ViewType.RENDERED);
            if (coverage != null) {

                // setting rendering hints
                RenderingHints hints = new RenderingHints(Collections.EMPTY_MAP);
                hints.add(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_SPEED));
View Full Code Here


                            if (object instanceof AbstractRasterGeoResource) {
                                AbstractRasterGeoResource rGeo = (AbstractRasterGeoResource) object;
                                AbstractGridCoverage2DReader gridCoverage2DReader = rGeo.resolve(
                                        AbstractGridCoverage2DReader.class, pm);
                                geodata = ((GridCoverage2D) gridCoverage2DReader.read(null));
                                geodata = geodata.view(ViewType.GEOPHYSICS);

                                Envelope envelope = geodata.getEnvelope();
                                DirectPosition lowerCorner = envelope.getLowerCorner();
                                double[] westSouth = lowerCorner.getCoordinate();
                                DirectPosition upperCorner = envelope.getUpperCorner();
View Full Code Here

                                GeneralParameterValue[] readParams = createGridGeometryGeneralParameter(cols, rows, north, south,
                                        east, west, mapEnvironment.getCoordinateReferenceSystem());
                                AbstractGridFormat format = (AbstractGridFormat) new GrassCoverageFormatFactory().createFormat();
                                AbstractGridCoverage2DReader reader = format.getReader(mapEnvironment.getCELL());
                                geodata = ((GridCoverage2D) reader.read(readParams));
                                geodata = geodata.view(ViewType.GEOPHYSICS);
                            } else {
                                MessageDialog.openInformation(shell, "WARNING", "Unable to read format");
                                return;
                            }
View Full Code Here

            CoordinateReferenceSystem fileCrs = null;
            GridCoverage2D geodata = null;
            if (mapFile.getName().endsWith(".asc")) {
                ArcGridReader arcGridReader = new ArcGridReader(mapFile);
                geodata = arcGridReader.read(null);
                geodata = geodata.view(ViewType.GEOPHYSICS);
                geodata = JGrassCatalogUtilities.removeNovalues(geodata);
                fileCrs = arcGridReader.getCrs();
            } else if (mapFile.getName().endsWith(".tif") || mapFile.getName().endsWith(".tiff")) {
                GeoTiffReader geotiffGridReader = new GeoTiffReader(mapFile);
                geodata = geotiffGridReader.read(null);
View Full Code Here

                geodata = JGrassCatalogUtilities.removeNovalues(geodata);
                fileCrs = arcGridReader.getCrs();
            } else if (mapFile.getName().endsWith(".tif") || mapFile.getName().endsWith(".tiff")) {
                GeoTiffReader geotiffGridReader = new GeoTiffReader(mapFile);
                geodata = geotiffGridReader.read(null);
                geodata = geodata.view(ViewType.GEOPHYSICS);
                geodata = JGrassCatalogUtilities.removeNovalues(geodata);
                fileCrs = geotiffGridReader.getCrs();
            }

            HashMap<String, Double> regionParams = JGrassCatalogUtilities.getRegionParamsFromGridCoverage(geodata);
View Full Code Here

                                            oldMapEnvironment.getCoordinateReferenceSystem());
                                    AbstractGridFormat format = (AbstractGridFormat) new GrassCoverageFormatFactory()
                                            .createFormat();
                                    AbstractGridCoverage2DReader reader = format.getReader(oldMapEnvironment.getCELL());
                                    GridCoverage2D geodata = ((GridCoverage2D) reader.read(readParams));
                                    geodata = geodata.view(ViewType.GEOPHYSICS);

                                    File mapsetFile = oldMapEnvironment.getMAPSET();
                                    JGrassMapEnvironment newMapEnvironment = new JGrassMapEnvironment(mapsetFile, newMapName);
                                    format = new GrassCoverageFormatFactory().createFormat();
                                    GridCoverageWriter writer = format.getWriter(newMapEnvironment.getCELL(), null);
View Full Code Here

        param.parameter("CoordinateReferenceSystem").setValue(targetCRS);
        param.parameter("InterpolationType").setValue("NearestNeighbor");
       
        reprojected = (GridCoverage2D) processor.doOperation(param);
       
        reprojected = reprojected.view(ViewType.RENDERED);
       
        ImageViewer.show(gridCoverage, "Normal Grid Coverage");
        ImageViewer.show(reprojected, "Reprojected Grid Coverage");
    }
}
View Full Code Here

        param.parameter("CoordinateReferenceSystem").setValue(targetCRS);
        param.parameter("InterpolationType").setValue("NearestNeighbor");
       
        reprojected = (GridCoverage2D) processor.doOperation(param);
       
        reprojected = reprojected.view(ViewType.RENDERED);
       
        ViewerOld.show(gridCoverage, "Normal Grid Coverage");
        ViewerOld.show(reprojected, "Reprojected Grid Coverage");
    }   
}
View Full Code Here

                                    GridCoverage2D geodata = null;
                                    CoordinateReferenceSystem fileCrs = null;
                                    if (mapFile.getName().toLowerCase().endsWith(".asc")) {
                                        ArcGridReader arcGridReader = new ArcGridReader(mapFile);
                                        geodata = arcGridReader.read(null);
                                        geodata = geodata.view(ViewType.GEOPHYSICS);
                                        geodata = JGrassCatalogUtilities.removeNovalues(geodata);
                                        fileCrs = arcGridReader.getCrs();
                                    } else if (mapFile.getName().toLowerCase().endsWith(".tif")
                                            || mapFile.getName().toLowerCase().endsWith(".tiff")) {
                                        GeoTiffReader geotiffGridReader = new GeoTiffReader(mapFile);
View Full Code Here

                                        fileCrs = arcGridReader.getCrs();
                                    } else if (mapFile.getName().toLowerCase().endsWith(".tif")
                                            || mapFile.getName().toLowerCase().endsWith(".tiff")) {
                                        GeoTiffReader geotiffGridReader = new GeoTiffReader(mapFile);
                                        geodata = geotiffGridReader.read(null);
                                        geodata = geodata.view(ViewType.GEOPHYSICS);
                                        geodata = JGrassCatalogUtilities.removeNovalues(geodata);
                                        fileCrs = geotiffGridReader.getCrs();
                                    }

                                    // if required, reproject
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.