[GRASS-user] Merging Raster Files in GRASS

Hi Everyone,
I have four DEM files to merge. their format is Tiff and I can merge them easily in QGIS and create a virtual Raster file. I can’t import that virtual layer into GRASS and I don’t know how can I do the same on GRASS GIS. If I could merge them to one big raster file in any possible way, that would be great.

None of the following has worked for me. (Maybe I am using them incorrectly in some cases or probably that’s my machine)

r.buildvrt in version (7.4.0 and 7.4.1)generated the following error:

‘r.buildvrt’ is not recognized as an internal or external command, operable program or batch file.

I have tried r.patch which doesn’t generate any error, although the created result is empty with no errors.

r.out.gdal and using the grouping option to group the layers and export them to a new Tiff, although that had a similar output as r.patch.

A virtual raster file in QGIS was created using the 4 Tiff files and importing to grass using r.import, didn’t work and I got errors.

I don’t want a fix for all of the above, I just wanted to share with you what I have done so far. Would you please help to merge the 4 Tiff files into one?

Thanks for your help,

Mehrdad

···

Mehrdad Varedi

Hi,

You need to set the computational region to the extent of the 4 tiles first:

g.region raster=map1,map2,map3,map4 -p

Then you can use r.patch. See ‘Notes’ section here: https://grass.osgeo.org/grass74/manuals/r.patch.html

HTH,
Vero

El mié., 10 oct. 2018 8:09, Mehrdad Varedi <varedi@gmail.com> escribió:

Hi Everyone,
I have four DEM files to merge. their format is Tiff and I can merge them easily in QGIS and create a virtual Raster file. I can’t import that virtual layer into GRASS and I don’t know how can I do the same on GRASS GIS. If I could merge them to one big raster file in any possible way, that would be great.

None of the following has worked for me. (Maybe I am using them incorrectly in some cases or probably that’s my machine)

r.buildvrt in version (7.4.0 and 7.4.1)generated the following error:

‘r.buildvrt’ is not recognized as an internal or external command, operable program or batch file.

I have tried r.patch which doesn’t generate any error, although the created result is empty with no errors.

r.out.gdal and using the grouping option to group the layers and export them to a new Tiff, although that had a similar output as r.patch.

A virtual raster file in QGIS was created using the 4 Tiff files and importing to grass using r.import, didn’t work and I got errors.

I don’t want a fix for all of the above, I just wanted to share with you what I have done so far. Would you please help to merge the 4 Tiff files into one?

Thanks for your help,

Mehrdad

Mehrdad Varedi


grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Just to clarify functionality for some of the modules.

On Wed, Oct 10, 2018 at 7:09 AM Mehrdad Varedi <varedi@gmail.com> wrote:

r.buildvrt in version (7.4.0 and 7.4.1)generated the following error:

‘r.buildvrt’ is not recognized as an internal or external command, operable program or batch file.

Available only in 7.6 (future release) and above.

I have tried r.patch which doesn’t generate any error, although the created result is empty with no errors.

Likely the computation region as Vero says.

r.out.gdal and using the grouping option to group the layers and export them to a new Tiff, although that had a similar output as r.patch.

The group r.out.gdal support is GRASS GIS imagery group created by i.group. That’s a GRASS GIS way of handling multiband images, or more precisely, a way to organize fully overlapping rasters together as a collection of spectral bands or related image processing outputs.

A virtual raster file in QGIS was created using the 4 Tiff files and importing to grass using r.import, didn’t work and I got errors.

This should work. (Files and error messages would be needed to understand what’s wrong, but if r.patch works for you that’s good).