1
Vote

Processing of GeoTiffs containing DEM 32-bit floating point data

description

If I read a 32bitFP Tiff (containing DEM elevation data) into SharpMap using this code:
using (Bitmap bmp = new Bitmap(256, 256, PixelFormat.Format64bppArgb))
{
   var mapBox = new Map(bmp.Size);
   var bbox = GeometryTransform.TransformBox(...);
   mapBox.ZoomToBox(bbox);

   using (Graphics g = Graphics.FromImage(bmp))
   {
      foreach (var file in _fileList)
      {
         var layer = new GdalRasterLayer(file, file);
         layer.ReprojectToCoordinateSystem(ProjectedCoordinateSystem.WebMercator);
         mapBox.Layers.Add(layer);
      }

      mapBox.RenderMap(g);
}
.. and then examine the grey scale Bitmap created, the 16 bit values (all identical for RGB as expected) do not correctly correspond to the 32bit FP cast to 16 bits.

My sample Tiff is 281MB in size so will provide a DropBox link on request by email.

comments