[gdal-dev] How do I find the anchor point in file?

Frank Warmerdam warmerdam at pobox.com
Wed Nov 17 12:32:00 EST 2010

Todd Smith wrote:
> Yeah and a little more investigation on my part showed me that Arc/Info 
> ASCII Grid files have their origin in the upper left anyway, even though 
> they have their lat/long coords in the lower left.  This is from 
> gCore\rasterio.cpp (line 243in 1.6.2).  In my RGB reads, with a 
> nPixelSpace of 3 and a nBufDataSize of 1, I could get away get away with 
> having GDAL "flip" my file data for me by using a negative value for 
> nLineSpace because GDALCopyWords handled that.  Memcpy doesn't do well 
> with a negative value for nLineSpace :).  It looks like I'll have to 
> have another function flip my buffer from top to bottom after my 
> RasterIO call. 


Negative values are supposed to be accepted for line spacings.  If you have
found a case where it fails please file a ticket on the issue.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list