[gdal-dev] Extract elevation from (latitude, longitude)
Carmelo Terrasi
terrasi.carmelo at gmail.com
Tue Aug 31 11:11:47 EDT 2010
Hello everybody,
first of all my apologies cause I'm a newbie with this stuff...
I'm trying to build a function able to extract altitude from latitude and
longitude as parameters.
Something like that: *double MyElevation(double lat, double lon)*
*
*
I'm using Dted level 0 to get the elevation (I've already read this post:
http://www.osgeo.org/pipermail/gdal-dev/2010-February/023457.html )
But I got lost... :(
*GDALAllRegister();
*
*pointerToDataSet=(GDALDataset*) GDALOpen("n30.dt0", GA_ReadOnly);*
* *
*double data[6];*
*double longitude, latitude;*
*
*
*pointerToDataSet->GetGeoTransform(data);*
*
*
*longitude=???;*
*latitude=???;*
* *
*double x = (longitude - pippo[0]) / pippo[1];*
*double y = (latitude - pippo[3]) / pippo[5];*
* *
*GDALRasterBand* pointerToBand;*
* *
*pointerToBand=pointerToDataSet->GetRasterBand(1);*
* *
*float *elevation;*
* *
*pointerToDataSet->RasterIO(?,?, ... , ?);*
*pointerToBand->RasterIO(?,?, ... , ?);*
I supposed I had to store elevation data into the buffer I created, I mean
the float pointer.
I got confused among these:
- the file *.dt0
- longitude and latitude
- parameters for RasterIO()
Every tips will be very appreciated, thanks a lot for your patience,
Regards,
Carmelo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100831/51ed1cab/attachment.html
More information about the gdal-dev
mailing list