5

I have a TIFF file of first day beyond 10 degrees at 2 m height covering the northern part of North America from 2012 to 2020. Each year is stored in a different band. Currently, the data type is Float32 for all bands, and I would like to change it to Int16or something similar. I know how to do it for a single band raster, but how can I do it for a multiband raster?

Here is the file information:

CRS EPSG:   4326 - WGS 84 - Geographic
Extent:     -172.5304334680000125,35.3037906650000011 : -52.5694104270000224,83.1300963930000023
Unit:       degrees
Width:      26708
Height:     10648
Data type:  Float32 - Thirty two bit floating point
GDAL Driver Description:    GTiff
GDAL Driver Metadata:       GeoTIFF
1
  • You're going to lose information in a 32-bit float/16-bit int conversion. If the different bands have significantly different stats, you may need to choose different origin and scale for each band (separately, then stack them together afterward).
    – Vince
    Nov 4, 2021 at 12:21

1 Answer 1

2

"Warp (reproject)" it and set Output data type to Int16

enter image description here

3
  • Reprojecting it through Warp makes the file insanely large (11.1 Gb), not exactly what I need for my Python script - BigTIFF error occurs.
    – Thomas
    Nov 3, 2021 at 17:55
  • @Thomas then you should provide the compression information (for the orig float32 raster) in your question.
    – user2856
    Nov 4, 2021 at 1:59
  • Add an "advanced parameter" to provide comression. Press the +, type COMPRESS in Name and LZW as Value (or whatever compression you want, see gdal.org/drivers/raster/gtiff.html#creation-options)
    – BERA
    Nov 4, 2021 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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