Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.
Updated manual page: here
The list of element names to search for is not fixed; any subdirectory of the mapset directory is a valid element name.
However, the user can find the list of standard GRASS element names in the file $GISBASE/etc/element_list. This is the file which g.remove, g.rename and g.copy use to determine which files need to be deleted/renamed/copied for a given entity type.
name='file_name' mapset='mapset_name' file='unix_filename' fullname='grass_fullname'
eval `g.findfile element=name mapset=name file=name`
eval `g.findfile element=cell file=elevation`
name= mapset= fullname= file=
if [ ! "$file" ] then exit 1 fi
Vector map example (including error message):
eval `g.findfile element=vector file="$G_OPT_V_INPUT"` if [ ! "$file" ] ; then g.message -e "Vector map <$G_OPT_V_INPUT> not found" exit 1 fi
Note: The Python shell in the wxGUI can be used for entering the following code:
import grass.script as gcore gcore.find_file('elevation', element = 'cell')
Last changed: $Date: 2016-03-15 14:08:33 -0700 (Tue, 15 Mar 2016) $
Available at: g.findfile source code (history)
Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.
Updated manual page: here
Main index | General index | Topics index | Keywords index | Full index
© 2003-2018 GRASS Development Team, GRASS GIS 7.0.7svn Reference Manual