[gdal-dev] getting height from Geotiff DEM

Ivan Lucena lucena_ivan at hotmail.com
Sat Jun 6 09:18:09 PDT 2015


Usually DEM are not unsigned 8 bit but if you are asking for GDT_Byte, that is what you will get. 

You should change that RasterIO() parameter to GDT_Float32 for example.

> Date: Sat, 6 Jun 2015 01:31:59 -0700
> From: jawahar_d at hotmail.com
> To: gdal-dev at lists.osgeo.org
> Subject: [gdal-dev] getting height from Geotiff DEM
> 
> Hi,
>    I have a geotiff dem. How can I get the height information given a pixel
> coordinate? I tried to get the data using
> gdErr = poDataset->GetRasterBand(1)->RasterIO(
> 				GF_Read, 0, 0, poDataset->GetRasterXSize(), poDataset->GetRasterYSize(),
> 				pBits, bmi.Header.biWidth, bmi.Header.biHeight, GDT_Byte,
> 				1, nScanSize);
> 
> but the data is either 0 or 255.
> 
> What is the right way to do this?
> 
> Thanks & regards,
> 
> D. Jawahar
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/getting-height-from-Geotiff-DEM-tp5209506.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
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150606/7ee2f815/attachment.html>


More information about the gdal-dev mailing list