Note: A new GRASS GIS stable version has been released: GRASS GIS 7.8, 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 tab 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$
Available at: g.findfile source code (history)
Note: A new GRASS GIS stable version has been released: GRASS GIS 7.8, available here.
Updated manual page: here
Main index | General index | Topics index | Keywords index | Graphical index | Full index
© 2003-2019 GRASS Development Team, GRASS GIS 7.4.5dev Reference Manual