I use GRASS 7.8.7 (2022).
For a DEM raster
r.fillnulls input=file1 output=file2
I get:
Registering primitives...
Using RST interpolation...
Locating and isolating NULL areas...
100%
Growing NULL areas
Assigning IDs to NULL areas
100%
Processing 1 map holes
Filling hole 1 of 1
ERROR: Invalid input <n=n+0>
ERROR: abandoned. Removing temporary maps, restoring user mask if needed:
I tried different tension values. Result is the same.
Bilinear method gives other error:
Using bilinear bspline interpolation
Patching fill data into NULL areas...
ERROR: Raster map <r_fillnulls_318_filled> not found
Traceback (most recent call last):
File "/usr/local/grass78/scripts/r.fillnulls", line 540, in <module>
main()
File "/usr/local/grass78/scripts/r.fillnulls", line 515, in main
output=output, overwrite=True)
File "/usr/local/grass78/etc/python/grass/script/core.py", line 441, in run_command
return handle_errors(returncode, returncode, args, kwargs)
File "/usr/local/grass78/etc/python/grass/script/core.py", line 343, in handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None r.patch --o input=rawdem,r_fillnulls_318_filled output=dem ended with error
Process ended with non-zero return code 1. See errors in the (error) output.
WARNING: No data base element files found
No idea about could it be
UPD: Result of g.region -p
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 1N
south: 0
west: 0
east: 1E
nsres: 1
ewres: 1
rows: 1
cols: 1
cells: 1
Looks strange, but rawdem layer that is the source for the operation looks good.
UPD2:
I added g.region raster=rawdem
after it is imported to grass.
Now I get another error ERROR: Input map has no holes. Check region settings.
Now g.region -p is
projection: 3 (Latitude-Longitude)
zone: 0
datum: wgs84
ellipsoid: wgs84
north: 65N
south: 50N
west: 115E
east: 125E
nsres: 0:00:03
ewres: 0:00:03
rows: 18000
cols: 12000
cells: 216000000
The resulting raster still is not generated. Seems to be a bug in r.fillnulls code: if there is no holes - the result isn't generated. Maybe I could previously check if there are some NaN values?
UPD3: Now another case. Previously we detected a bug in r.filnulls algorhythm, that I sent to github. Here is an n+0 error with file that HAS zero values:
> r.univar -ge rawdem
n=684000000
null_cells=72000000
> r.fillnulls input=rawdem output=dem --verbose
Growing NULL areas
Assigning IDs to NULL areas
100%
Processing 1 map holes
Filling hole 1 of 1
ERROR: Invalid input <n=n+0>
ERROR: abandoned. Removing temporary maps, restoring user mask if needed:
The error is same, there is 72000000 nulls in the layer. But here the cause is that the rawdem raster (which is an external of vrt) does not have all tiles of DEM. So, r.univar thinks, that it has nulls, but in reality these nulls are due to holes in data. Of course it is worth to check previously, if all tiles are present for DEM, but it is not too memory savy to provide always rectangular regions only in order to fill null values. So, developers could consider to add an algorhythm, that understands where there is a hole and where there is a null edge of the map.
And with bilinear the same case gives:
> r.fillnulls input=rawdem output=dem method=bilinear --verbose
Using bilinear bspline interpolation
Patching fill data into NULL areas...
ERROR: Raster map <r_fillnulls_667_filled> not found
Traceback (most recent call last):
File "/usr/local/grass78/scripts/r.fillnulls", line 540, in <module>
main()
File "/usr/local/grass78/scripts/r.fillnulls", line 515, in main
output=output, overwrite=True)
File "/usr/local/grass78/etc/python/grass/script/core.py", line 441, in
run_command
return handle_errors(returncode, returncode, args, kwargs)
File "/usr/local/grass78/etc/python/grass/script/core.py", line 343, in
handle_errors
returncode=returncode)
grass.exceptions.CalledModuleError: Module run None r.patch --o
input=rawdem,r_fillnulls_667_filled output=dem ended with error
Process ended with non-zero return code 1. See errors in the (error)
output.
WARNING: No data base element files found
g.region -p
.g.region -g
in my script? But where?ogr2ogr -f CSV -spat $EXTENT list.csv an_index.shp
writes tiles for extentgdalbuildvrt -input_file_list list.csv dem.vrt
builds a dem filer.external input=$DIR_PATH/dem.vrt output=rawdem
imports it Where should I set the region?