Hi Michael,
I posted the same problem in the list for the ArcgridReader a couple
of days ago but got no answer.
I got it now. :)
So for most readers:
GeneralParameterValue[] readParams = new GeneralParameterValue[1];
Parameter<GridGeometry2D> readGG = new Parameter<GridGeometry2D>(
AbstractGridFormat.READ_GRIDGEOMETRY2D);
GridEnvelope2D gridEnvelope = new GridEnvelope2D(0, 0, width, height);
DirectPosition2D minDp = new DirectPosition2D(west, south);
DirectPosition2D maxDp = new DirectPosition2D(east, north);
Envelope env = new Envelope2D(minDp, maxDp);
readGG.setValue(new GridGeometry2D(gridEnvelope, env));
readParams[0] = readGG;
does indeed set only the resolution. That is odd.
In the grass raster reader for example the bounding box has an impact
also on the region.
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.
Andrea
On Wed, May 5, 2010 at 9:09 AM, Michael Bedward
<[email protected]> wrote:
> Hi Martin,
>
>> Yes, I know about gdal, but I wanted a fully automated solution within
>> geotools.
>
> Simone is the guru for this but I'm not sure that there a GeoTools
> only solution exists at the moment.
>
> What would be nice is if the GeoTiffReader accepted a parameter for
> the envelope to read (either a GridEnvelope2D for grid coords or an
> Envelope for world coords). At present you can provide a
> GridGeometry2D parameter to the read method (contrary to what the
> javadocs say about parameters being ignored) but unfortunately this
> only seems to be used to set the resolution of the returned coverage
> rather than its extent.
>
> Michael
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Geotools-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>
------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel