[gdal-dev] Using GDAL.Transformer from C#
Reed Copsey, Jr.
reedc+gdal at ctech.com
Thu Oct 16 13:47:06 EDT 2008
I'm looking for the best approach to figuring out the specific projected
coordinate of a raster read via the GDAL C# wrappers.
If I open a dataset using Gdal.Open(...) which has projection information,
what is the best way in C# to determine the actual coordinate of a specific
pixel?
For example, I want to determine where, in projected space, the pixel at
[50,25] in image coordinates might lie.
Right now, I'm calculating this by hand using the
dataset.GetGeoTransform(...) array, but this is less simple if the
transformation isn't simple. I'd ideally like a solution that works with
GCP defined datasets, as well.
It looks like GDAL.Transformer is the way to go here, but the C# wrappers
only seem to work by taking a dataset to project from and to, and then
transforming a coordinate from one to the other. Is the best approach to
create a dataset in memory with 1 pixel wide spacing, located at the origin,
and use that as from and the loaded dataset as the "to" dataset? Is there
an easier/simpler/faster approach?
Thank you,
Reed Copsey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20081016/4f541f26/attachment.html
More information about the gdal-dev
mailing list