Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.fillnulls: proceed if no holes present (RST method) #3122

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/r.fillnulls/r.fillnulls.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h2>NOTES</h2>
may pay attention to below notes.
<p>
If interpolation fails, temporary raster and vector maps are left in place to allow
unfilled map hole (NULL area) identification and manual repair.
unfilled map holes (NULL areas) to be identified and manually repaired.

<p>
When using the default RST method, the algorithm is based
Expand Down
11 changes: 10 additions & 1 deletion scripts/r.fillnulls/r.fillnulls.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,16 @@ def main():
os.remove(cats_file_name)

if len(cat_list) < 1:
grass.fatal(_("Input map has no holes. Check region settings."))
# no holes found in current region
grass.run_command(
"g.copy", raster="%s,%sfilled" % (input, prefix), overwrite=True
)
grass.warning(
_(
"Input map <%s> has no holes. Copying to output without modification."
)
% (input,)
)

# GTC Hole is NULL area in a raster map
grass.message(_("Processing %d map holes") % len(cat_list))
Expand Down
Loading