Package org.geotools.coverage.grid

Examples of org.geotools.coverage.grid.GridCoverageFactory.create()


         */
        AffineTransform expected = getAffineTransform(grid);
        assertNotNull(expected);
        expected = new AffineTransform(expected); // Get a mutable instance.
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
        grid = factory.create("Translated",image, grid.getEnvelope(), grid.getSampleDimensions(),new GridCoverage2D[]{grid}, grid.getProperties());
        expected.translate(-transX, -transY);
        assertTransformEquals(expected, getAffineTransform(grid));
       
        /*
         * Apply the "Resample" operation with a specific 'gridToCoordinateSystem' transform.
View Full Code Here


            array[i] = (byte) random.nextInt(161);
        }
        final MathTransform identity = IdentityTransform.create(2);
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
        GridCoverage2D coverage;
        coverage = factory.create("Test", source, DefaultGeographicCRS.WGS84,
                    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.
         */
 
View Full Code Here

        /*
         * Construct a new image with the resulting data, and apply an inverse transformation.
         * Compare the resulting values with the original data.
         */
        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);
View Full Code Here

                }
            }
        }
       
        GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(null);
        GridCoverage2D coverage = gcf.create("cov", image, WORLD);
       
        File file = File.createTempFile("test-image", ".tiff");
        GeoTiffWriter writer = new GeoTiffWriter(file);
        writer.write(coverage, null);
        writer.dispose();
View Full Code Here

            }
        }
        final CoordinateReferenceSystem crs = DefaultGeographicCRS.WGS84;
        final Envelope envelope = new Envelope2D(crs, 0, 0, 30, 30);
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
        return factory.create("My grayscale float coverage", raster, envelope);
    }

    /**
     * Tests the "Extrema" operation with a raster of floating point values.
     * This test compare the operation results with the expected ones using
View Full Code Here

            {5, 6, 7, 8}
        };
       
        ReferencedEnvelope env = new ReferencedEnvelope(0, 4, 0, 2, null);
        GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(null);
        GridCoverage2D cov = gcf.create("coverage", data, env);
        Layer layer = new GridCoverageLayer(cov, null);
       
        InfoToolHelper helper = InfoToolHelperLookup.getHelper(layer);
        assertNotNull(helper);
        assertEquals(GridCoverageLayerHelper.class, helper.getClass());
View Full Code Here

                }
            }
        }
       
        GridCoverageFactory gcf = CoverageFactoryFinder.getGridCoverageFactory(null);
        coverage = gcf.create("cov", image, WORLD);
    }
}
View Full Code Here

    Envelope envelope = new Envelope2D((CoordinateReferenceSystem)crs,
                      ge.getXMin(), ge.getYMin(),
                      ge.getWidth(), ge.getHeight());
    GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
    GridCoverage2D gc = factory.create(name, (WritableRaster)m_Raster, envelope,
        null, null, null, null, null);
    m_BaseDataObject = gc;
    m_sName = name;
    m_sFilename = filename;
    m_LayerExtent = ge;
View Full Code Here

            raster.setSample(x, y, i, this.getCellValueAsDouble(x, y, i));
          }
        }

      }
      m_BaseDataObject = factory.create(getName(), (WritableRaster)raster, envelope,
                      null, null, null, null, null);

      System.gc();
    }
View Full Code Here

       
        // build the output sample dimensions, use the default value ( 0 ) as the no data
        final GridSampleDimension outSampleDimension = new GridSampleDimension("classification",
                new Category[] { Category.NODATA }, null).geophysics(true);
        final GridCoverageFactory factory = CoverageFactoryFinder.getGridCoverageFactory(null);
        final GridCoverage2D output = factory.create("reclassified", indexedClassification, coverage
                .getGridGeometry(), new GridSampleDimension[] { outSampleDimension },
                new GridCoverage[] { coverage }, new HashMap<String,Double>(){{
                  put("GC_NODATA",0d);
                }});
        return output;
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.