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: jawaha...@hotmail.com
> To: gdal-dev@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@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
                                          
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to