I have two raster layers, A and B, which have information about the same location but have different projections and datums.

How can I reproject layer A to match the projection and datum of layer B?

Trying to use r.proj yields:

ERROR: Input raster map is outside current region

When I use g.region to set the region to layer B, I get the same error.

When I use g.region to set the region to layer A, then the input and output projections are the same.

Layer A has a projection of:

Projection: Lambert Conformal Conic                                 
N: 5786515.18365295    S: 5349685.18365295   Res:    30         
E: -13519426.48582491    W: -13806586.48582491   Res:    30 

Layer B has a projection of

Projection: Lambert Conformal Conic                                 
N:    5087310    S:    4800360   Res:    30                     
E:     606210    W:     440460   Res:    30 

The Lambert Conformal Conic is because this is the projection I selected for the Location. Presumably the specific values of the LCC occurred when the raster layers were imported.

  • 1
    1st, you can reproject raster map files outside of GRASS, simply by using gdal utilities. 2nd, if the maps are referenced in different projection systems, it is not possible to have them imported inside the same GRASS Location. You should have created an independent Location for each of your raster maps (since they are projected in different systems). Then, as markusN "answered" reproject from one Location to another. – Nikos Alexandris May 17 '13 at 12:55

Using r.proj, You can either reproject map B into the location of map A (or vice verse), or create a third location with a yet different projection and reproject both maps into it. More precise info about the situation (which projections do you have?) would be helpful, though.

  • Thanks, @markusN. I'm afraid this yielded a few problems for me, which I have appended to the question. – Richard Mar 27 '13 at 20:12

It would be very helpful if you could give us the region information for each location. You can get the details from each location by executing :

 g.region -p

I think you haven't set the default region from the start for both regions. The default region spawns to n=1 s=1 e=1 w=1 which it is very generic probably invalid and it doesn't make any sense at all, especially if it's a projected CRS.

What you can do, is for each location to set g.region to something valid using the command :

g.region rast=<name_of_rast>

And then retry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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