0

I'm trying to create a hydro-flattened DEM according to USGS specifications. I have two rasters, a DEM of my study area and a raster that only contains the water bodies that I have flattened so the pixels represent a flat surface for each of the lakes.

I've created a polygon mask that I've used to remove the lakes from the original DEM and used the saga:invertnodata tool to create an opposite mask that I used to generate the second raster containing only the flattened lakes.

When I try to combine the two rasters, my resulting image is blank with the only values recorded in the legend as 1.79769e+308 and -1.79769e+308 (for some reason -infinity is the upper bound but that may be trivial at this point).

I cannot for the life of me figure out why adding the two rasters (using simple addition in raster calculator) results in -infinity and +infinity. I suspect is has to do the masked values in each raster have a value of 'no data' but I've tried converting each raster's 'no data' values through gdal warp, translate, and a couple other tools that are supposed to convert no data values to a specified value.

Has anyone ever encountered this, or have another method to handle and convert 'no data' to 0?

5
  • In ArcGis I'd use cell statistics maximum of two, ignore nodata.
    – FelixIP
    Commented Apr 30, 2020 at 1:52
  • Could you check (gdalinfo) the extent of two input files? If they are not the same raster calculation tends to produce nodata raster.
    – Kazuhito
    Commented Apr 30, 2020 at 10:34
  • The extents are identical, only difference between the two is one is float 32 and the other is float 64
    – Rob
    Commented Apr 30, 2020 at 11:16
  • Can you post gdalinfo output of each file (two input files and the problematic output layer)? By the way (if in doubt), QGIS raster calculator can handle calculation between Float32 and Float64.
    – Kazuhito
    Commented Apr 30, 2020 at 23:19
  • The gdalinfo files for both are identical besides the Float32/64. I don't think it's an issue with the files, this result has now popped up after using a few different gdal tools and now I suspect it's a problem with the driver.
    – Rob
    Commented May 1, 2020 at 18:17

0

Your Answer

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

Browse other questions tagged or ask your own question.