<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Usually DEM are not unsigned 8 bit but if you are asking for GDT_Byte, that is what you will get. <br><br>You should change that RasterIO() parameter to GDT_Float32 for example.<br><br><div>> Date: Sat, 6 Jun 2015 01:31:59 -0700<br>> From: jawahar_d@hotmail.com<br>> To: gdal-dev@lists.osgeo.org<br>> Subject: [gdal-dev] getting height from Geotiff DEM<br>> <br>> Hi,<br>> I have a geotiff dem. How can I get the height information given a pixel<br>> coordinate? I tried to get the data using<br>> gdErr = poDataset->GetRasterBand(1)->RasterIO(<br>> GF_Read, 0, 0, poDataset->GetRasterXSize(), poDataset->GetRasterYSize(),<br>> pBits, bmi.Header.biWidth, bmi.Header.biHeight, <b>GDT_Byte</b>,<br>> 1, nScanSize);<br>> <br>> but the data is either 0 or 255.<br>> <br>> What is the right way to do this?<br>> <br>> Thanks & regards,<br>> <br>> D. Jawahar<br>> <br>> <br>> <br>> --<br>> View this message in context: http://osgeo-org.1560.x6.nabble.com/getting-height-from-Geotiff-DEM-tp5209506.html<br>> Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>> _______________________________________________<br>> gdal-dev mailing list<br>> gdal-dev@lists.osgeo.org<br>> http://lists.osgeo.org/mailman/listinfo/gdal-dev<br></div> </div></body>
</html>