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

Kyle Shannon ksshannon at gmail.com
Tue Nov 16 20:22:24 EST 2010


I am not totally sure, but I believe that the gdal data model always uses
the upper left corner for the origin, even on files that reference the lower
left in space. I think this is also the way rasterio handles it.  See
RasterIO docs:

http://gdal.org/classGDALDataset.html#e077c53268d2272eebed10b891a05743

Specifically the nXOff and nYOff parameters.

kss
# ============================
Kyle Shannon
Physical Science Technician
RMRS Fire Sciences Lab
Fire, Fuels & Smoke - RWU 4405
5775 Highway 10 W.
Missoula, MT 59808
(406)829-6954
kshannon at fs.fed.us
# ============================


On Tue, Nov 16, 2010 at 5:28 PM, Todd Smith <smith.todd at gmail.com> wrote:

> The default way of doing things at my company is to treat the lower left
> corner of a file as the origin.  Thus when I call RasterIO on a GeoTIFF, I
> make the buffer I pass as pData address to the last row of the buffer I've
> allocated, and I make nLineSpace negative.  This has the effect of reading
> the file from the beginning, but placing each line into my buffer starting
> at the last and finishing at the first line.  This was working great until I
> started reading ArcInfo/Ascii files with origins in the lower-left.  In this
> case, I wouldn't want to address to the last row of my buffer, I'd want to
> address to the beginning of my buffer, and use a positive value for my line
> space.
>
> Is there metadata that will tell me where the file's origin is?  If not,
> any suggestions as to how to deal with this problem?
>
> Thanks!
>
> Todd
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20101116/c621e431/attachment.html


More information about the gdal-dev mailing list