Computational region: Difference between revisions
(Added FAQ entry on the -a flag) |
(+How to subset a raster map) |
||
Line 15: | Line 15: | ||
'''A:''' Typically the computational region is set to an area not covering the raster map of interest. Use {{cmd|g.region}} to adjust the computational region settings, e.g. by setting it to the raster map: | '''A:''' Typically the computational region is set to an area not covering the raster map of interest. Use {{cmd|g.region}} to adjust the computational region settings, e.g. by setting it to the raster map: | ||
<source lang="bash"> | |||
g.region rast=myrastermap -p | |||
</source> | |||
'''Using the graphical user interface:''' | '''Using the graphical user interface:''' | ||
Line 31: | Line 32: | ||
'''A:''' Sometimes, the resolution of the computational region is not matching exactly the resolution entered to {{cmd|g.region}}. Here's an example: | '''A:''' Sometimes, the resolution of the computational region is not matching exactly the resolution entered to {{cmd|g.region}}. Here's an example: | ||
<source lang="bash"> | |||
g.region rast=myrastermap res=1 -p | |||
(...) | |||
nsres: 0.9993515 | |||
ewres: 1.00025576 | |||
(...) | |||
</source> | |||
To force the computational region to match the resolution entered, you need to use the -a flag: | To force the computational region to match the resolution entered, you need to use the -a flag: | ||
<source lang="bash"> | |||
g.region rast=myrastermap res=1 -ap | |||
(...) | |||
nsres: 1 | |||
ewres: 1 | |||
(...) | |||
</source> | |||
<br> '''Q:''' The raster map looks ugly. | <br> '''Q:''' The raster map looks ugly. | ||
Line 53: | Line 56: | ||
'''A:''' You likely try to use more memory than your computer offers which is commonly caused by a too high raster resolution (or too large computational region). E.g., it is pointless to calculate common DEM data at nanometer raster resolution. Set the region extent and raster resolution properly with {{cmd|g.region}} (in the wxGUI: menu Settings -> Region -> Display Region | Set Region). | '''A:''' You likely try to use more memory than your computer offers which is commonly caused by a too high raster resolution (or too large computational region). E.g., it is pointless to calculate common DEM data at nanometer raster resolution. Set the region extent and raster resolution properly with {{cmd|g.region}} (in the wxGUI: menu Settings -> Region -> Display Region | Set Region). | ||
'''Q:''' I want to subset a raster map! | |||
'''A:''' While this is done on the fly by setting the computational region properly, you can still create a subset raster map copy with | |||
<source lang="bash"> | |||
r.mapcalc "subset = original_map" | |||
</source> | |||
[[Category: Documentation]] | [[Category: Documentation]] | ||
[[Category: FAQ]] | [[Category: FAQ]] | ||
[[Category: Tutorial]] | [[Category: Tutorial]] |
Revision as of 11:35, 7 September 2013
The current region or computational region is the actual setting of the region boundaries and the actual raster resolution.
As a general rule in GRASS:
- Raster maps are always imported completely at their own resolution (exception: WMS imported layers).
- Vector maps are always imported completely.
- In computations,
- raster input maps are automatically cropped/padded and rescaled (using nearest neighbour resampling) to match the current region in order to produce the output raster map or to query values.
- Raster output maps have their bounds and resolution equal to those of the current computational region.
- Vector maps are always considered completely.
FAQs
Q: I don't see anything!
A: Typically the computational region is set to an area not covering the raster map of interest. Use g.region to adjust the computational region settings, e.g. by setting it to the raster map:
g.region rast=myrastermap -p
Using the graphical user interface:
Set display to selected map:
Set computational region to selected map:
Q: The resolution of my region is not the one I asked for!
A: Sometimes, the resolution of the computational region is not matching exactly the resolution entered to g.region. Here's an example:
g.region rast=myrastermap res=1 -p
(...)
nsres: 0.9993515
ewres: 1.00025576
(...)
To force the computational region to match the resolution entered, you need to use the -a flag:
g.region rast=myrastermap res=1 -ap
(...)
nsres: 1
ewres: 1
(...)
Q: The raster map looks ugly.
A: The resolution of the computational region does not match the resolution of the raster map. Use g.region to adjust the resolution settings of the computational region or set it to the raster map (see above).
Q: I get "xyz module: G_malloc error"
A: You likely try to use more memory than your computer offers which is commonly caused by a too high raster resolution (or too large computational region). E.g., it is pointless to calculate common DEM data at nanometer raster resolution. Set the region extent and raster resolution properly with g.region (in the wxGUI: menu Settings -> Region -> Display Region | Set Region).
Q: I want to subset a raster map!
A: While this is done on the fly by setting the computational region properly, you can still create a subset raster map copy with
r.mapcalc "subset = original_map"