Hello list,
now that I've solved my problems *reading* big raster data, I'm also
trying to *write* them.
I've written some testing code:
CoordinateReferenceSystem crs = CRS.decode(crsString);
Envelope envelope = new Envelope2D(crs, 0, 0, 60000, 60000);
Raster m_Raster =
RasterFactory.createBandedRaster(DataBuffer.TYPE_FLOAT,
60000, 60000, 1, null);
GridCoverageFactory factory =
CoverageFactoryFinder.getGridCoverageFactory(null);
GridCoverage2D gc = factory.create("bigtif",
(WritableRaster)m_Raster, envelope,
null, null, null, null, null);
AbstractGridCoverageWriter writer = new GeoTiffWriter(m_sFilename);
writer.write(gc.geophysics(true), null);
writer.dispose();
However, the method createBandedRaster fails (as I was expecting...):
java.lang.IllegalArgumentException: Size of array must be smaller
than Integer.MAX_VALUE.
at javax.media.jai.RasterFactory.createBandedRaster(RasterFactory.java:307)
Is there a better way to achieve this?
Regards,
César
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
César Martínez Izquierdo
GIS developer
- - - - - - - - - - - - - - - - - - - -
ETC-LUSI: http://etc-lusi.eionet.europa.eu/
Universitat Autònoma de Barcelona (SPAIN)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users