the GDALReadDirect were really helpful to minimize the code we need to read
GDAL images from C#. But always there is sth missing. We are rarely using
GDAL to read a whole image at it's original size. Mostly, we use it to read
just a part of it.
E.g. one of our test cases is the worldatnight.jpg file. It's envelope is
-180,-90,180,90 and size let's say 1800x2400 pixels. Now, to generate a map
containing the correct part of this image we have to do some calculations.
E.g. if map size is 883x605 pixels and current envelope is
-3.34,39.5,-3.20,40.0 the call to band.ReadRaster? is still not a trivial
thing for unexperienced users. It is another suggestion, but I think the
following new call may be added to the wishlist:
byte[] buf = band.ReadRaster? (int imgWidth, int imgHeight, Envelope env)
I don't know if it should be exactly this syntax or sth similar, but it
should be even useful as a new method within GDAL. A good example is the
ECW SDK, which is hiding all these inner calculations to the end user. In
GDAL it did not find anything similar and remember some initial headaches
with it until everything worked correctly. E.g. the map envelope may be
totally outside of the image envelope, or the image is only partially
contained within the current map, etc. Imagining relatively unexperienced
developers with the same problem, I am sure that a direct method call would
be widely accepted.