[gdal-dev] GDAL Newbie - Get Height from a DTED
Chaitanya kumar CH
chaitanya.ch at gmail.com
Fri Jul 8 10:07:46 EDT 2011
Migel,
You have the corner coordinates. Now you need to know the pixel value at a
particular position. You can calculate the pixel value from the projection
coordinates using the affine transformation coordinates. You can get the
these coordinates using GDALDataset::GetGeoTransform() method. Knowing the
pixel/line information, you can read the pixel value using
GDALDataset::RasterIO().
You can check out the code [1] of the gdallocationinfo utility [2].
[1]: http://trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdallocationinfo.cpp
[2]: http://www.gdal.org/gdallocationinfo.html
On Fri, Jul 8, 2011 at 7:15 PM, migelanjel <edarel256 at gmail.com> wrote:
> Hello there!
> First let me you that i'm quite new in this, so if there's anything that
> you
> may is basic, please let me know anyway, cause to me it may be the puzzle
> piece i'm missing.
>
> So, here's what i need to do. I have a DTED file (dt2), and i'm trying to
> get the elevation data to map it over a jpg image, and show it in the
> screen
> so i can know the elevation of the point the mouse is over in any moment.
> I've loaded the DTED file, and i've been able to read the coordinates of
> the
> corners of te raster band, but i don't if i can get the elevation data in a
> numeric way. I've been reading the doc in the GDAL website but all i could
> find about this was "How to draw the data to images".
>
> Could anyone tell me how to get the numeric elevation data?
>
> I'm using the C# inteface (because i'll be using XNA to do all the
> drawing),
> but i can understand C, and a little bit of C++ too, so don't worry about
> that.
>
> Thanks a lot for reading this!
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/GDAL-Newbie-Get-Height-from-a-DTED-tp6562549p6562549.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
--
Best regards,
Chaitanya kumar CH.
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110708/9dfff1b5/attachment.html
More information about the gdal-dev
mailing list