Skip to content

Commit

Permalink
t.rast.patch.group: include r.buildvrt.gdal (#65)
Browse files Browse the repository at this point in the history
Addresses performance issues with r.buildvrt used with GDAL-linked raster maps
  • Loading branch information
ninsbl authored Oct 1, 2024
1 parent 1811d03 commit 560815c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/temporal/t.rast.patch.group/t.rast.patch.group.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
# % multiple: no
# %end

# %flag
# % key: g
# % description: Use r.buildvrt.gdal for patching (for GDAL-linked raster maps)
# %end

# %flag
# % key: z
# % description: Use zero (0) for transparency instead of NULL
Expand All @@ -88,7 +93,8 @@
# %end

# %rules
# % excludes: -v,-s,-z
# % excludes: -v,-s,-z,-g
# % excludes: -g,-s,-z,-v
# %end

import sys
Expand Down Expand Up @@ -119,7 +125,17 @@ def main():
add_time = flags["t"]
patch_s = flags["s"]
patch_z = flags["z"]
patch_module = "r.buildvrt" if flags["v"] else "r.patch"

if flags["g"] and not gs.find_program("r.buildvrt.gdal", "--help"):
gs.fatal(
_("Cannot find addon <r.buildvrt.gdal>. Please make sure it is installed.")
)
if flags["v"]:
patch_module = "r.buildvrt"
elif flags["g"]:
patch_module = "r.buildvrt.gdal"
else:
patch_module = "r.patch"

# Make sure the temporal database exists
dbif = tgis.init()
Expand Down

0 comments on commit 560815c

Please sign in to comment.