Hi guys (Andrea *2, Michael )
thanks for the hints. Indeed, the GridGeometry2D approach will not help
my case, but a similar approach should be somehow possible.
IN fact, if it was possible to read the current envelope of the geotiff
in without the actual raster data, do the cropping operation and return
a meaningful return envelope, and only read parts of the raster in it
would be great.
Thanks for the pointer to the cropping operation, I do something similar
now, although it still requires having the whole original GridCoverage2D
in memory...:
public static GridCoverage2D cropGridCoverage(GridCoverage2D coverage,
ReferencedEnvelope crop){
final AbstractProcessor processor = new DefaultProcessor(null);
final ParameterValueGroup param =
processor.getOperation("CoverageCrop").getParameters();
param.parameter("Source").setValue( coverage );
param.parameter("Envelope").setValue( crop );
GridCoverage2D cropped = (GridCoverage2D)
processor.doOperation(param);
return cropped;
}
without the cloning, and directly using a referenced envelope.
Cheers
Martin
On 5/5/2010 9:28 AM, Michael Bedward wrote:
> Hi Andrea,
>
>
>> If it is like you say I feel that is really a big missing piece that
>> we should fill in, even if for now with a "dirty" cropping of the
>> coverage.
>>
>>
> I'd like to wait for Simone or Daniele to comment too but I certainly
> agree with you. The present arrangement of providing a GridGeometry2D
> object to the reader to set only the grid resolution seems pretty
> obscure... secret knowledge in fact :-)
>
> If Simone is agreeable I think it would be really useful to flesh out
> the parameters for the read method to cater for obvious requests
> including Martin's case, plus document them.
>
> Michael
>
>
>
--
Martin Tomko
Postdoctoral Research Assistant
Geographic Information Systems Division
Department of Geography
University of Zurich - Irchel
Winterthurerstr. 190
CH-8057 Zurich, Switzerland
email: [email protected]
site: http://www.geo.uzh.ch/~mtomko
mob: +41-788 629 558
tel: +41-44-6355256
fax: +41-44-6356848
------------------------------------------------------------------------------
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users