1

I have two rasters with very slightly different resolution and the same number of cells. I need to adjust the resolution from one of the rasters (Raster 1) to match the other (Raster 2).

Is there a solution in GRASS?

Summary from Raster 1.

    +----------------------------------------------------------------------------+
    | Map:      Stream                         Date: Mon Feb 26 17:01:06 2018    |
    | Mapset:   PERMANENT                      Login of Creator: Guido           |
    | Location: newLocation                                                      |
    | DataBase: F:\M2 Stage                                                      |
    | Title:                                                                     |
    | Timestamp: none                                                            |
    |----------------------------------------------------------------------------|
    |                                                                            |
    |   Type of Map:  raster               Number of Categories: 0               |
    |   Data Type:    FCELL                                                      |
    |   Rows:         2810                                                       |
    |   Columns:      2535                                                       |
    |   Total Cells:  7123350                                                    |
    |        Projection: Latitude-Longitude                                      |
    |            N: 2:56:30.012N    S:  20:28:30S   Res: 0:00:30.000004          |
    |            E: 58:28:59.988W    W: 79:36:29.988W   Res: 0:00:30             |
    |   Range of data:    min = 47295  max = 301894                              |
    |                                                                            |
    |   Data Description:                                                        |
    |    gnr par r.in.gdal                                                       |
    |                                                                            |
    |   Comments:                                                                |
    |    r.in.gdal -k input="F:\M2 Stage\Topography\Stream_Raster.tif" output\   |
    |    ="Stream" memory=300 offset=0 num_digits=0                              |
    |                                                                            |
    +----------------------------------------------------------------------------+

Summary from Raster 2.

      +----------------------------------------------------------------------------+
      | Map:      Direction                      Date: Mon Feb 26 17:02:25 2018    |
      | Mapset:   PERMANENT                      Login of Creator: Guido           |
      | Location: newLocation                                                      |
      | DataBase: F:\M2 Stage                                                      |
      | Title:                                                                     |
      | Timestamp: none                                                            |
      |----------------------------------------------------------------------------|
      |                                                                            |
      |   Type of Map:  raster               Number of Categories: 0               |
      |   Data Type:    FCELL                                                      |
      |   Rows:         2810                                                       |
      |   Columns:      2535                                                       |
      |   Total Cells:  7123350                                                    |
      |        Projection: Latitude-Longitude                                      |
      |            N:   2:56:30N    S:  20:28:30S   Res: 0:00:30                   |
      |            E:     58:29W    W:  79:36:30W   Res: 0:00:30                   |
      |   Range of data:    min = 1  max = 128                                     |
      |                                                                            |
      |   Data Description:                                                        |
      |    gnr par r.in.gdal                                                       |
      |                                                                            |
      |   Comments:                                                                |
      |    r.in.gdal -k input="F:\M2 Stage\Topography\Direction_Andean.tif" out\   |
      |    put="Direction" memory=300 offset=0 num_digits=0                        |
      |                                                                            |
      +----------------------------------------------------------------------------+                                                   
2

The command r.region does it. You can either set it from a raster (Raster 2), the current region or the default region, there are more, it is plenty of options.

In your case, it could be like this:

r.region map=Stream raster=Direction

Man page: https://grass.osgeo.org/grass72/manuals/r.region.html

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.