Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a raster with signed float values as the pixel values and display the results in MapWindow on windows.

What is the proper gdal band type to use? I've tried both gdal.GDT_Byte and gdal.GDT_Float32 and using both methods I can't seem to get the pixels displayed. If I change the pixel value to the abs() value they will display.

dataset = driver.Create(filename, cols, rows, number_of_bands, gdal.GDT_Byte)

gdal.GDT_CFloat32 allows for negative numbers but doesn't properly display the floating point value past the point.

share|improve this question
There's something strange about this question, because there is no such thing as an unsigned float, afaik. I wonder what kind of values you really are trying to store in this raster? – whuber May 23 '12 at 21:22
I too want to store DEM data as plain headerless binary float32. I'm using a workaround, but I'm surprised GDAL can't handle plain old binary format. – user13187 Nov 29 '12 at 8:52
Please describe this workaround, so others may benefit from it. – lynxlynxlynx Nov 29 '12 at 10:13

gdal.GDT_Byte is 8 bit unsigned (0-255). You don't want that. You want gdal.GDT_Float32. If you can't see the result, try calculating statistics - dataset.ComputeStatistics(0) - before displaying.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.