Geotiffs exported from RealityCapture do not have the nodata value (from the geotiff spec) set correctly.
- DSM have a value of
nan
for pixels which do not fall under a mesh polygon, but nodata is undefined (it should then be set to nan) - RGB geotiffs have an alpha band, with
alpha = 0
for such pixels (rather than 255 for opaque or anything different than zero for semi-transparent pixels)
Any subsequent processing applied within standard GIS libs (gdal, qgis, saga, grass etc) therefore requires editing the nodata value via either of these:
gdal_edit -a_nodata nan geotiff.tif
gdal_calc.bat -A dsm.tiff --outfile=dsm-correct-nodata.tiff --calc="nan_to_num(A, nan=-9999)" --NoDataValue=-9999
RC should set the nodata on the geotiff metadata correctly.
Additional bug: DSM have lots of small (often 1 or 2px) holes on tiles seams (with nan value). This become even more apparent when the dsm geotiffs are tiled into COGs (Cloud Optimized Geotiffs). Hence the need to use the gdal_fill
utility beforehand to fix this second RC bug.