[Gdal-dev] C# Bindings

Simon Perkins sy at perkins.net
Sun Nov 5 13:52:52 EST 2006


Simon Perkins wrote:
> OK, I see how this would work now. As you might guess, I still don't 
> like the extra copying just to use a typesafe version of the method 
> and to avoid the /UNSAFE keyword, but that's a personal preference. As 
> long as the high performance IntPtr version of Read/WriteRaster() is 
> available, I'll be happy...

Just to play devil's advocate a little, I'm going to point out that the 
extra cost involved with allocating an intermediate buffer and copying 
data for the typesafe versions of Read/WriteRaster() might actually not 
be that significant...

 GDAL already does some intermediate copying of data since internally it 
reads blocks of data, stores those in a cache, and then copies from 
there to the user's buffer. In addition, if the block data has to be 
fetched from disk, the cost of the disk I/O is certain to dwarf the cost 
of a few extra memory copies...

Cheers!

Sy




More information about the Gdal-dev mailing list