My problem goes like this:

I have a gridded data in netCDF file. The cells have values in meters. For example: 0,012. I only need a small area of the grid and after clipping it in QGIS using a shapefile mask the values are multiplied with 10 000, result for the same cell being 120. I have to mention that the clipping is done on all the bands (365/366) without creating an alpha band. GDAL code looking fine.

Any ideas why it goes like this?

1 Answer 1


Have a look at the file's metadata. Most probably the values are stored as integer, with an internal scale factor of 10000. Reading the untouched file, QGIS applies the scale factor automatically.

The clipping is done by the external GDAL command gdal_translate, and that destroys the correct handling of the scale factor from the metadata.

As a workaround, use the raster calculator to divide all cell values by 10000. You might need to switch the cell value data type from integer to real using -ot as well. See http://www.gdal.org/gdal_translate.html for the full coammand line syntax.

  • Thanks, guess this might be the problem. At least I know the numbers are not erroneous. Raster calculator does the trick, but I have to import the cropped file in SAGA, and when I create the map of the band, the output display is inverted upside down. Any clue for that? GDAL processing messing around?
    – crisvr
    Sep 5, 2016 at 12:35
  • I don't know much about SAGA. Is the algorithm you need included in QGUS processing? Then you could stick to QGIS.
    – AndreJ
    Sep 5, 2016 at 12:41
  • Not really. I suppose I can go with QGIS all along, but I am more acquainted with the SAGA workflow. It is just annoying because the map is always upside down and I have to rectify it's position each time I need it for any kind of portrayal. Looked at the projection, everything fine there.
    – crisvr
    Sep 5, 2016 at 19:44

Your Answer

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

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