Hello,
i want to get a subset of a GridCoverage2D with the subset specified by
an JTS-Envelope.
I tried to do this with Operations.crop(.):
GridCoverage2D sourceGrid = ...;
com.vividsolutions.jts.geom.Envelope jtsEnv = ...; // Coordinates in UTM
//#### transform JTS-Envelope to GeneralEnvelope needed by crop(.) ####
org.geotools.geometry.Envelope2D gtEnv2D =
JTS.getEnvelope2D(jtsEnv,sourceGrid.getCoordinateReferenceSystem());
org.opengis.spatialschema.geometry.Envelope gtGenEnv =
new GeneralEnvelope((org.opengis...Envelope)gtEnv2D);
//#### use crop(.) to create a grid subset ####
GridCoverage2D subsetGrid =
(GridCoverage2D)Operations.DEFAULT.crop(sourceGrid,gtGenEnv);
But when I add 'subsetGrid' to my JMapPane it looks IDENTICAL to
'sourceGrid'! Maybe the crop method does nothing, but return the
'sourceGrid'. Unfortunately I miss the source code of
org.geotools.coverage.processing.operation.Crop in gt2-2.3.1a-src.zip.
So I can not analyze by myself how crop(.) works.
At all: Is the crop-method the right way to create a grid subset? Or is
there another (better) solution?
Actually I want 'subsetGrid' to be a completely new grid with its own
dimension (not the dimension of 'sourceGrid' with NoData in the
non-subset cells).
Thanks for help...
Martin Schmitz
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users