5

Everytime with every function (e.g convert data storage type or gdal-translat -ot Byte) the output is a completely white map with a black border. only the "save as" export works, but the TIFF also has 3 bands and the data is much bigger..this isnt my intention

Has anybody an idea?

  • 1
    Show gdalinfo -stats reports from the original and converted. Put a sample image to play with somewhere for downloading if you have right to do it. – user30184 Sep 17 '14 at 14:28
  • what is the range of your input values ? – radouxju Sep 17 '14 at 14:30
  • value range of the input scene is 0 - 25480.812476 value range of the wrong created 8 bit is 0 - 255 enclosed u will find a link which contais the 16 bit single-band (free content): file-upload.net/download-9541350/… – Thelema Sep 17 '14 at 19:37
  • Try adding -scale src_min src_max in gdal_translate code. src_min and src_max values based on yours 16bit raster value range will be needed to scale down to 8bit (see detailed description: gdal.org/gdal_translate.html) – jzol Sep 17 '14 at 20:10
  • ive tried this and fortunatly the output has had the correct value range 0-255 + -ot byte command i have now the result i wanted to have. thanks! – Thelema Sep 17 '14 at 21:56
4

Lets have a close look at statistics about scene enclosed by you:

C:\Program Files\QGIS Chugiak\bin>gdalinfo C:\Users\Janek\Desktop\LC819402420142
48LGN00_B5.TIF -stats

[...]

  Metadata:
    STATISTICS_MAXIMUM=65535 - this especially!

    STATISTICS_MEAN=10396.365071613

    STATISTICS_MINIMUM=0 - and this one

    STATISTICS_STDDEV=7547.8323562457

... and histogram:

enter image description here

Having it's real values in much narrower range - to perform raster conversion you should force scaling in gdal_translate

Add -scale src_min src_max in gdal_translate code src_min and src_max values based on yours 16bit raster real value range, and -ot Byte to force 8bit value type. To omit no data areas add also a_nodata 0.

Try something like this:

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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