Package org.geotools.coverage.grid

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


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

                                    final ArcGridFormat format1 = new ArcGridFormat();
                                    final ArcGridWriteParams wp = new ArcGridWriteParams();
                                    final ParameterValueGroup paramWrite = format1.getWriteParameters();
                                    paramWrite.parameter(AbstractGridFormat.GEOTOOLS_WRITE_PARAMS.getName().toString()).setValue(
View Full Code Here


                GridEnvelope range = reader.getOriginalGridRange();
                GeneralEnvelope env = reader.getOriginalEnvelope();
                GridGeometry2D all = new GridGeometry2D(range, env);
                GridCoverage2D coverage2d = (GridCoverage2D) super.load(all, monitor);
                RenderedImage image = coverage2d.view(ViewType.RENDERED).getRenderedImage();

        RasteringsPlugin
            .log("WARNING.  Loading image fully into memory.  It is about " + size(image) + " MB in size decompressed", null); //$NON-NLS-1$//$NON-NLS-2$

                @SuppressWarnings("rawtypes")
View Full Code Here

         */
        coverage = deriveGridCoverage(sources, new BandMergeParams(crs, gridToCRS, globalBbox,
                block, hints));
        // Addition of a view of the specific type if present
        if (primarySourceType != null) {
            coverage = coverage.view(primarySourceType);
        }

        return coverage;
    }

View Full Code Here

                    identity, new GridSampleDimension[] {band}, null, null);
        /*
         * Apply the operation. The SampleTranscoder class is suppose to transform our
         * integers into real-world values. Check if the result use floating-points.
         */
        final RenderedImage target = coverage.view(ViewType.GEOPHYSICS).getRenderedImage();
        assertSame(target, PlanarImage.wrapRenderedImage(target));
        assertEquals(DataBuffer.TYPE_BYTE, source.getSampleModel().getDataType());
        if (coverage.getRenderedImage() != target) {
            assertEquals(DataBuffer.TYPE_FLOAT, target.getSampleModel().getDataType());
        }
View Full Code Here

         */
        RenderedImage back = PlanarImage.wrapRenderedImage(target).getAsBufferedImage();
        coverage = factory.create("Test", back, DefaultGeographicCRS.WGS84,
                    identity, new GridSampleDimension[]{band.geophysics(true)}, null, null);

        back = coverage.view(ViewType.PACKED).getRenderedImage();
        assertEquals(DataBuffer.TYPE_BYTE, back.getSampleModel().getDataType());
        sourceData = source.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[]) null);
        targetData =   back.getData().getSamples(0, 0, SIZE, SIZE, 0, (double[]) null);
        CategoryListTest.compare(sourceData, targetData, 1.0 + EPS);
        /*
 
View Full Code Here

        // Bilinear interpolation and non-geo view for a float coverage
        //
        ///////////////////////////////////////////////////////////////////////
        // on this one the subsample average should NOT go back to the
        // geophysiscs view before being applied
        warp(floatCoverage.view(PACKED), interp);

        ///////////////////////////////////////////////////////////////////////
        //
        // Nearest neighbor  interpolation and non-geo view for a float coverage
        //
View Full Code Here

        //
        ///////////////////////////////////////////////////////////////////////
        // on this one the subsample average should NOT go back to the
        // geophysiscs view before being applied
        interp = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
        warp(floatCoverage.view(PACKED), interp);

        // Play with a rotated coverage
        warp(rotate(floatCoverage.view(GEOPHYSICS), Math.PI/4), null);
    }
View Full Code Here

        // geophysiscs view before being applied
        interp = Interpolation.getInstance(Interpolation.INTERP_NEAREST);
        warp(floatCoverage.view(PACKED), interp);

        // Play with a rotated coverage
        warp(rotate(floatCoverage.view(GEOPHYSICS), Math.PI/4), null);
    }

    /**
     * Applies a scale on the photographic view of the given coverage.
     *
 
View Full Code Here

        // view before being applied.
        filteredSubsample(originallyIndexedCoverage.view(PACKED), interp, filter);

        // On this one the subsample average should go back to the
        // geophysics view before being applied.
        filteredSubsample(floatCoverage.view(PACKED), interp, new float[]{1},
                new Hints(Hints.COVERAGE_PROCESSING_VIEW, PHOTOGRAPHIC));

        // Play with a rotated coverage.
        filteredSubsample(rotate(floatCoverage.view(GEOPHYSICS), Math.PI/4), interp, filter);
    }
View Full Code Here

        // geophysics view before being applied.
        filteredSubsample(floatCoverage.view(PACKED), interp, new float[]{1},
                new Hints(Hints.COVERAGE_PROCESSING_VIEW, PHOTOGRAPHIC));

        // Play with a rotated coverage.
        filteredSubsample(rotate(floatCoverage.view(GEOPHYSICS), Math.PI/4), interp, filter);
    }

    /**
     * Tests the "FilteredSubsamble" operation.
     *
 
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.