Download Grass Tutorial
Transcript
Chapter 12. The GRASS Region What is the region The "region" is a cornerstone concept in GRASS. If you want to be able to use GRASS to its full potential, you have to understand it. In fact, it is so important that you should know about it even if you only plan some light usage of GRASS. This chapter is an attempt at explaining as clearly as possible what the region is and what its effects are. It will also, hopefully, help you understand the usefulness of the region in GRASS. The region defines the geographic area in which GRASS should work. It is characterized by several parameters: • geographical projection (e.g. UTM, latitude-longitude, Gauss-Krueger, etc) • geographical extension, i.e. the North/South/East/West limits of the area covered • number of columns and number of rows for the data • resolution, i.e. the extension divided by the number of rows (N-S resolution), respectively columns (E-W resolution). The default values of these parameters for a given location are stored in the DEFAULT_WIND file in the PERMANENT mapset of that location. The current region settings are stored in the WIND in the current mapset. The stored values will stay valid, even if you exit GRASS and restart it. Why care about the region As said above, the region defines the extension and resolution of the data on which most GRASS commands should work. But what does that mean ? For instance, if the region is set to a smaller extension than that of the map you are working on, a display command for that map (such as d.rast) will only show the portion of the map that is contained in that region. Many other commands will also only work on that region, as for example many of the export commands, or many of the raster development modules. This allows working on only a portion of the map, thus not using up your computer’s ressources for the rest of the map. Or you can export only the portion of a map that really interests you. In a similar way, you can reduce the resolution of the region in order to use less machine resources. For example, you might want to convert a vector map to raster, but do not need the raster in very high resolution, as, for example, if you want to create a thematic map of the world, where the exact contours of the countries are not very important. You can, therefore, change the region settings to a lower resolution before launching the conversion, so that it takes less time and memory. In general, you always have to be careful to assure that the region is set correctly before doing any work on your map. A typical problem of newcomers to GRASS is that they import a map and then try to display it, but only see an empty GRASS monitor. This is almost always due to wrong region settings which make the map fall outside the area currently covered by the region. Ideally, the default region of a location should encompass the entire area covered by all the maps in that location. So if you reset your region to the default, subsequent commands should always cover your entire location. If however, you import a map that is larger than the default region, you can still set the current region to that new map’s settings by using (see below for an explanation of these commands) g.region rast=name or g.region vect=name. However, whenever you use g.region -d you will reset your current region to the default which does not contain the new, larger map. 27