man g.mapsets () - Modifies the user's current mapset search path, affecting the user's access to data existing under the other GRASS mapsets in the current location.


g.mapsets - Modifies the user's current mapset search path, affecting the user's access to data existing under the other GRASS mapsets in the current location.



g.mapsets help

g.mapsets [-lp] [mapset=string[,string,...]] [addmapset=string[,string,...]]


list all available mapsets
print current mapset search path


Name(s) of existing mapset(s)
Name(s) of existing mapset(s) to add to search list


A mapset holds a distinct set of data layers, each relevant to the same (or a subset of the same) geographic region, and each drawn in the same map coordinate system. At the outset of every GRASS session, the user identifies a GRASS data base, location, and mapset that are to be the user's current data base, current location, and current mapset for the duration of the session; any maps created by the user during the session will be stored under the current mapset ($MAPSET) set at the session's outset.

The user can add, modify, and delete data layers that exist under his current mapset. Although the user can also access (i.e., use) data that are stored under other mapsets in the same GRASS location, the user can only make permanent changes (create or modify data) located in the current mapset. The user's mapset search path lists the order in which other mapsets in the same GRASS location can be searched and their data accessed by the user. The user can modify the listing and order in which these mapsets are accessed by modifying the mapset search path; this can be done using the g.mapsets command. This program allows the user to use other's relevant map data without altering the original data layer, and without taking up disk space with a copy of the original map.

g.mapsets shows the user available mapsets under the current GRASS location, lists mapsets to which the user currently has access, and lists the order in which accessible mapsets will be accessed by GRASS programs searching for data files. The user is then given the opportunity to add or delete mapset names from his search path, or modify the order in which mapsets will be accessed.

When the user specifies the name of a data base element file (e.g., a particular vector file, raster file, imagery group file, etc.) to a GRASS program, the program searches for the named file under each of the mapsets listed in the user's mapset search path in the order listed there until the program finds a file of the given name. (Users can also specify a file by its mapset, to make explicit the mapset from which the file is to be drawn; e.g., the command: g.copy rast='soils.file@PERMANENT',my.soils

ensures that a new file named my.soils is to be a copy of the file soils.file from the mapset PERMANENT.)

It is common for a user to have the special mapset PERMANENT included in his mapset search path, as this mapset typically contains finished base maps relevant to many applications. Often, other mapsets which contain sets of interpreted map layers will be likewise included in the user's mapset search path. Suppose, for example, that the mapset Soil_Maps contains interpreted soils map layers to which the user wants access. The mapset Soil_Maps should then be included in the user's search path variable.

The mapset search path is saved as part of the current mapset. When the user works with that mapset in subsequent GRASS sessions, the previously saved mapset search path will be used (and will continue to be used until it is modified by the user with g.mapsets).



List all available mapsets under the user's current location.
Print the user's current mapset search path to standard output.


Name(s) of existing GRASS mapset(s) under the current location.
Name(s) of existing mapset(s) to add to search list

g.mapsets sets the current mapset search path to the mapsets named on the command line. If g.mapsets is typed but no mapset names are specified by the user on the command line, the program will print the user's current mapset search path, list available mapsets, and prompt the user for a new mapset search path listing.

The addmapset parameter allows for extending an existing mapset search path.


Users can restrict others' access to their mapset files through use of the GRASS program g.access. Mapsets to which access is restricted can still be listed in another's mapset search path; however, access to these mapsets will remain restricted.







Michael Shapiro, U.S.Army Construction Engineering Research Laboratory

Greg Koerper, ManTech Environmental Technology, Inc.

Last changed: $Date: 2004/08/05 12:53:21 $

Help Index