From: Alessio F. <ale...@gm...> - 2006-04-20 14:35:11
|
Hi Joe, one method to this could be the following: 1) Create your dummy writable raster //Defining output array as WriteableRaster WritableRaster outDataCube; SampleModel outSampleModel =3D RasterFactory.createBandedSampleMode= l( DataBuffer.TYPE_DOUBLE, //data type width, height, numBands); outDataCube =3D Raster.createWritableRaster(outSampleModel,null); ... here with a WritableRasterIterator, or what you want, you can fill the buffer with everything... WritableRandomIter iteratorDataCube; iteratorDataCube =3D RandomIterFactory.createWritable(outDataCube, null); for (int jj =3D 0; jj < outDataCube.getNumBands(); jj++) { for (int kk =3D 0; kk < outDataCube.getWidth(); kk++) { for (int ll =3D 0; ll < outDataCube.getHeight(); ll++) { iteratorDataCube.setSample(kk, ll, jj, doubleValue); } } } 2) Create the GridCoverage2D GridCoverage coverage; ColorModel cm =3D PlanarImage.createColorModel(outSampleModel); BufferedImage bImage=3D new BufferedImage(cm,outDataCube,false,null); coverage =3D new GridCoverage2D((CharSequence) "coverage name", (RenderedImage) bImage, gridCRS, IdentityTransform.create(2), null, null, null); Hope this help, Alessio On 4/19/06, Joe McMahon <joe...@gm...> wrote: > > Is there a way to programmatically create an "empty" (i.e. no data or > false-data) GridCoverage2D that would have the same footprint as metadata > that I have? In this case, I have 4 corner points in WGS84 and a pixel > resolution (width & height of image in pixels). The size is substantial = ( > i.e. width and heights in the 10,000s of pixels - like 27000x22000 pixel > images). > > Thanks, > joe > -- --------------------------------------------------------- Alessio Fabiani Software Engineer http://afabiani.wordpress.com --------------------------------------------------------- |