Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have elevation rasters which loaded just fine in a GRASS session. They represent adjacent areas, so I want to meld them into one raster.

I ran r.patch using the GRASS GUI, and it would only accept one input raster at a time in the input files field. So I used the command line in a terminal window. The result was an error message saying that the rasters: cannot be found -- the directory does not exist.

To run r.patch, do the input files have to reside in the Location folder I'm using for the GRASS session? That doesn't seem right. GRASS had no problem finding the same files to simply load them into the map window.

I'm running GRASS on Ubuntu machines (11.10 Oneiric Ocelot). Thank you.

share|improve this question
    
Oh -- maybe GRASS did not like the file path symbology. I just copied the file path for each raster and pasted into the command line. Does a normal file path (with ' / ' between folder names) not work in GRASS commands in terminal windows? –  Catlike Apr 6 '12 at 3:09

1 Answer 1

up vote 2 down vote accepted

The maps have to reside in the same location but not necessarily in the same mapset(s). Use g.mapsets to add mapsets to the search path if not in the current mapset.

As input, r.patch accepts a comma separated list (without white space). As a first step, we need to set the computation region to all raster maps (in GRASS the current = computation region defines the settings of raster map operations, i.e. spatial extent and resolution).

Example:

g.region rast=raster1,raster2,raster3 -p

r.patch in=raster1,raster2,raster3 out=mosaic

share|improve this answer
    
In your example, why do you have the line "g.region rast=raster1,raster2,raster3 -p" ? What is the purpose of that? I see in GRASS manual that "g.region" with the "-p" is to show the current region. Why do we need that here? Thank you. –  Catlike Apr 11 '12 at 8:56
1  
Please enjoy the r.patch manual :) but I'll edit my posting... –  markusN Apr 11 '12 at 18:31
    
Got it. Thanks. –  Catlike Apr 19 '12 at 7:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.