For the resulting maps GDAL VRT text files are created either in a directory named "gdal" in the current mapset or in a user-defined vrt_directory. Those files are not removed when the raster map is removed and the user is responsible for removing them when needed.
# Create external example data
regs='s,0,1000
n,500,1500'
eval `g.gisenv`
external_path="${GISDBASE}/${LOCATION}/${MAPSET}/.tmp/vrt"
mkdir -p "$external_path"
for reg in $regs
do
r=$(echo $reg | cut -f1 -d",")
s=$(echo $reg | cut -f2 -d",")
n=$(echo $reg | cut -f3 -d",")
g.region -g n=$n s=$s w=0 e=1000 res=1
r.external.out format=GTiff options="compress=LZW,PREDICTOR=3" \
directory="$external_path"
r.mapcalc --o --v expression="${r}_${s}_gtiff_ntfs=float(x()*y())"
done
# Run performance tests
g.region -g n=1500 s=0 w=0 e=1000 res=1
format_type=gtiff_ntfs
rmaps=$(g.list type=raster pattern="*_*_${format_type}", sep=",")
# Using GRASS GIS VRT
r.buildvrt --o --v input="$rmaps" output=vrt_${format_type}
time r.univar map=vrt_${format_type}
# Using GDAL VRT
r.buildvrt.gdal --o --v input="$rmaps" output=vrt_${format_type}_gdal
time r.univar map=vrt_${format_type}_gdal
Available at: r.buildvrt.gdal source code (history)
Latest change: Thursday Feb 20 13:02:26 2025 in commit: 53de8196a10ba5a8a9121898ce87861d227137e3
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS 8.5.0dev Reference Manual