0

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?

3
  • Please edit and add the output of g.region -p.
    – markusN
    May 25 at 22:38
  • Strange, I updated. My DEM looks good. But g.region shows strange values. May 26 at 7:30
  • So I should use eval g.region -g in my script? But where? ogr2ogr -f CSV -spat $EXTENT list.csv an_index.shp writes tiles for extent gdalbuildvrt -input_file_list list.csv dem.vrt builds a dem file r.external input=$DIR_PATH/dem.vrt output=rawdem imports it Where should I set the region? May 26 at 7:40

1 Answer 1

0

Your initial g.region values shows those of a freshly created location: 1 pixel only.

Then, using g.region raster=myrastermap sets it to the boundary box and the spatial resolution of the raster map (so you did then, good).

Importantly, raster computation adheres to the currently set https://grasswiki.osgeo.org/wiki/Computational_region.

Now, if r.fillnulls reports "Input map has no holes" then the raster map doesn't have any hole in the current computational region. Maybe visual inspection can help here (the current region is shown as a red box on the map, try to zoom out if you don't see it).

Edit:

I have made a test with a sample map which does not contain a hole (North Carolina sample dataset):

GRASS 7.8.8dev (nc_spm_08_grass7): > g.region raster=elevation

# A) using bilinear method
GRASS 7.8.8dev (nc_spm_08_grass7): > r.fillnulls input=elevation output=elev_fill_test method=bilinear
Using bilinear bspline interpolation
Copy raster <elevation@PERMANENT> to current mapset as
<r_fillnulls_1844093_filled>
WARNING: Input map <elevation> has no holes. Copying to output without
         modification.
Patching fill data into NULL areas...
 100%
Filled raster map is: elev_fill_test
Done.

# B) using default RST method
GRASS 7.8.8dev (nc_spm_08_grass7):~/software/grass78_git > r.fillnulls input=elevation output=elev_fill_test2
Using RST interpolation...
Locating and isolating NULL areas...
 100%
Growing NULL areas
Assigning IDs to NULL areas
 100%
ERROR: Input map has no holes. Check region settings.

I agree that the latter is a bit confusing: it should also just copy the full map as in the bilinear method case.

Can you please open an issue for that at https://github.com/OSGeo/grass/issues? I can already confirm this behavior for GRASS GIS 8.2.

5
  • Well, it doesn't have any holes. But I don't know it apriori for every file, it should simply go on if there is no holes, why it throws an error? May 27 at 12:39
  • 1
    I have now tested myself, see edits above. Can you please open an issue for that at github.com/OSGeo/grass/issues? I can already confirm this behavior for GRASS GIS 8.2.
    – markusN
    May 29 at 13:59
  • 1
    Ok, I opened an issue there. Thank you. May 29 at 14:28
  • What shall we do with issue here? We don't close it until the bug isn't fixed? May 29 at 14:29
  • I'd keep it open here for now. For the record: RST issue tracked at github.com/OSGeo/grass/issues/2986
    – markusN
    Jun 1 at 12:27

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.