grass7.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!-- meta page description: GRASS startup program -->
  2. <h2>SYNOPSIS</h2>
  3. <b>grass70</b> [<b>-h</b> | <b>-help</b> | <b>--help</b>] [<b>-v</b> | <b>--version</b>]
  4. [<b>-c</b> | <b>-c geofile</b> | <b>-c EPSG:code[:datum_trans]</b>]
  5. [<b>-text</b> | <b>-gtext</b> | <b>-gui</b>]
  6. [[[<b>&lt;GISDBASE&gt;/</b>]<b>&lt;LOCATION_NAME&gt;/</b>]
  7. <b>&lt;MAPSET&gt;</b>]
  8. <h3>Flags:</h3>
  9. <dl>
  10. <dt><b>-h</b> | <b>-help</b> | <b>--help</b>
  11. <dd> Prints a brief usage message and exits
  12. <dt><b>-v</b> | <b>--verbose</b>
  13. <dd> Prints the version of GRASS and exits
  14. <dt><b>-c</b>
  15. <dd> Creates new GRASS unprojected location in specified GISDBASE
  16. <dt><b>-c geofile</b>
  17. <dd> Creates new GRASS projected location in specified GISDBASE based on georeferenced file
  18. <dt><b>-c EPSG:code</b>
  19. <dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code
  20. <dt><b>-c EPSG:code:datum_trans</b>
  21. <dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code and datum transform parameters
  22. <dt><b>-text</b>
  23. <dd> Indicates that Text-based User Interface should be used (skip welcome screen)
  24. <dt><b>-gtext</b>
  25. <dd> Indicates that Text-based User Interface should be used (show welcome screen)
  26. <dt><b>-gui</b>
  27. <dd> Indicates that Graphical User Interface
  28. (<em><a href="wxGUI.html">wxGUI</a></em>) should be used
  29. </dl>
  30. <h3>Parameters:</h3>
  31. <dl>
  32. <dt><b>GISDBASE</b>
  33. <dd> Initial database directory which should be a fully qualified path
  34. (e.g., <tt>/usr/local/share/grassdata</tt>)
  35. <dt><b>LOCATION_NAME</b>
  36. <dd> Initial location directory which is a subdirectory of GISDBASE
  37. <dt><b>MAPSET</b>
  38. <dd> Initial mapset directory which is a subdirectory of LOCATION_NAME
  39. </dl>
  40. <i>Note</i>: These parameters must be specified in one of the
  41. following ways:
  42. <div class="code"><pre>
  43. MAPSET
  44. LOCATION_NAME/MAPSET
  45. GISDBASE/LOCATION_NAME/MAPSET
  46. </pre></div>
  47. <h2>DESCRIPTION</h2>
  48. <p>This command is used to launch GRASS GIS. It will parse the command
  49. line arguments and then initialize GRASS for the user. Since GRASS
  50. modules require a specific environment, this program must be called
  51. before any other GRASS module can run. The command line arguments are
  52. optional and provide the user with a method to indicate the desired
  53. user interface, as well as the desired mapset to work on.
  54. <p>The startup program will remember both the desired user interface
  55. and mapset. Thus, the next time the user runs GRASS, typing
  56. <em>grass70</em> (without any options) will start GRASS with the
  57. previous settings for the user interface and mapset selected.
  58. <p>If you specify a graphical user interface (<b>-gui</b>)
  59. the <em>grass70</em> program will try to verify that the system you
  60. specified exists and that you can access it successfully. If any of
  61. these checks fail then <em>grass70</em> will automatically switch back
  62. to the text user interface mode.
  63. <h2>ENVIRONMENT VARIABLES</h2>
  64. A number of environment variables are available at GRASS startup to
  65. assist with automation and customization. Most users will not need to
  66. bother with these.
  67. <p>In addition to these shell environment variables GRASS maintains a
  68. number of GIS environment variables in the <tt>$HOME/.grass7/rc</tt>
  69. file. User changes to this file will be read during the next startup
  70. of GRASS. If this file becomes corrupted the user may edit it by hand
  71. or remove it to start afresh. See the list
  72. of <em><a href="variables.html">implemented GRASS variables</a></em>
  73. for more information. The rest of this help page will only consider
  74. shell environment variables.
  75. <p>Note that you will need to set these variables using the
  76. appropriate method required for the UNIX shell that you use (e.g. in a
  77. Bash shell you must <tt>export</tt> the variables for them to
  78. propagate).
  79. <h3>User Interface Environment Variable</h3>
  80. <p>The <em>grass70</em> program will check for the existence of an
  81. environment variable called GRASS_GUI which indicates the type of user
  82. interface for GRASS to use. If this variable is not set
  83. when <em>grass70</em> is run, then it will be created and then saved
  84. in the <tt>$HOME/.grass7/rc</tt> file for the next time GRASS is
  85. run. It can be set to <tt>text</tt>, <tt>gtext</tt> or <tt>gui</tt>.
  86. <p>There is an order of precedence in the way <em>grass70</em>
  87. determines the user interface to use. The following is the hierarchy
  88. from highest precedence to lowest.
  89. <ol>
  90. <li>Command line argument
  91. <li>Environment variable GRASS_GUI
  92. <li>Value set in <tt>$HOME/.grass7/rc</tt> (GUI)
  93. <li>Default value - <tt>gui</tt>
  94. </ol>
  95. <h3>Python Environment Variables</h3>
  96. <p>If you choose to use <em><a href="wxGUI.html">wxGUI</a></em>
  97. interface, then the GRASS_PYTHON environment variable can be used to
  98. override your system default <tt>python</tt> command.
  99. <p>Suppose for example your system has Python 2.5 installed and you
  100. install a personal version of the Python 2.6 binaries
  101. under <tt>$HOME/bin</tt>. You can use the above variables to have
  102. GRASS use the Python 2.6 binaries instead.
  103. <div class="code"><pre>
  104. GRASS_PYTHON=python2.6
  105. </pre></div>
  106. <h3>Addon Path to Extra User Scripts</h3>
  107. This environment variable allows the user to extend the GRASS program
  108. search paths to include locally developed/installed GRASS modules or
  109. user scripts.
  110. <div class="code"><pre>
  111. GRASS_ADDON_PATH=/usr/mytools
  112. GRASS_ADDON_PATH=/usr/mytools:/usr/local/othertools
  113. </pre></div>
  114. <p>In this example above path(s) would be added to the standard GRASS path
  115. environment.
  116. <h3>Addon Base for Extra Local GRASS Addon Modules</h3>
  117. This environment variable allows the user to extend the GRASS program
  118. search paths to include locally installed
  119. (see <em><a href="g.extension.html">g.extension</a></em> for details)
  120. <a href="http://grasswiki.osgeo.org/wiki/GRASS_AddOns">GRASS Addon</a>
  121. modules which are not distributed with the standard GRASS release.
  122. <div class="code"><pre>
  123. GRASS_ADDON_BASE=/usr/grass-addons
  124. </pre></div>
  125. <p>In this example above path would be added to the standard GRASS
  126. path environment.
  127. <p>If not defined by user, this variable is set by GRASS startup program
  128. to <tt>$HOME/.grass7/addons</tt> on GNU/Linux
  129. and <tt>$APPDATA\GRASS7\addons</tt> on MS Windows.
  130. <h3>HTML Browser Variable</h3>
  131. The GRASS_HTML_BROWSER environment variable allows the user to set the
  132. HTML web browser to use for displaying help pages.
  133. <h3>Location Environment Variables</h3>
  134. <p>The <b>Synopsis</b> section above describes options that can be used
  135. to set the location and mapset that GRASS will use. These values can
  136. also be set with environment variables. However, specifying the
  137. location and mapset variables on the command line will override these
  138. environment variables. The available variables are as follows:
  139. <dl>
  140. <dt>LOCATION
  141. <dd> A fully qualified path to a mapset
  142. (eg <tt>/usr/local/share/grassdata/spearfish60/PERMANENT</tt>). This
  143. environment variable overrides the GISDBASE, LOCATION_NAME, and
  144. MAPSET variables.
  145. <dt>GISDBASE
  146. <dd> Initial database directory which should be a fully qualified path
  147. (eg <tt>/usr/local/share/grassdata</tt>)
  148. <dt>LOCATION_NAME
  149. <dd> Initial location directory which is a subdirectory of GISDBASE
  150. <dt>MAPSET
  151. <dd> Initial mapset directory which is a subdirectory of LOCATION_NAME
  152. </dl>
  153. <h3>Running non-interactive batch jobs</h3>
  154. If the GRASS_BATCH_JOB environment variable is set to the <i>full</i>
  155. path and filename of a shell script then GRASS will be launched in a
  156. non-interactive way and the script will be run. The script itself can
  157. be interactive if that is what the user requires. When it is finished
  158. GRASS will automatically exit using the exit-success code given by the
  159. script. The script file must have its executable bit set.
  160. <h2>EXAMPLES</h2>
  161. <p>The following are some examples of how you could start GRASS
  162. <dl>
  163. <dt><b>grass70</b>
  164. <dd> Start GRASS using the default user interface. The user will be
  165. prompted to choose the appropriate location and mapset.
  166. <dt><b>grass70 -gui</b>
  167. <dd> Start GRASS using the graphical user interface. The user will be
  168. prompted to choose the appropriate location and mapset.
  169. <dt><b>grass70 -text</b>
  170. <dd> Start GRASS using the text-based user interface. Appropriate
  171. location and mapset must be set by environmental variables (see
  172. examples below) otherwise taken from the last GRASS session.</dd>
  173. <dt><b>grass70 -gtext</b>
  174. <dd> Start GRASS using the text-based user interface. The user will be
  175. prompted to choose the appropriate location and mapset.
  176. <dt><b>grass70 $HOME/grassdata/spearfish60/user1</b>
  177. <dd> Start GRASS using the default user interface and automatically
  178. launch into the given mapset, bypassing the mapset selection menu.
  179. <dt><b>grass70 -gui -</b>
  180. <dd> Start GRASS using the graphical user interface and try to
  181. obtain the location and mapset from environment variables.
  182. <dt><b>grass70 -c EPSG:4326 $HOME/grassdata/mylocation</b>
  183. <dd> Creates new GRASS location with EPSG code 4326 (latitude-longitude, WGS84)
  184. in the specified GISDBASE
  185. <dt><b>grass70 -c EPSG:5514:3 $HOME/grassdata/mylocation</b>
  186. <dd> Creates new GRASS location with EPSG code 5514 (S-JTSK / Krovak
  187. East North - SJTSK) with datum transformation parameters used in
  188. Czech Republic in the specified GISDBASE
  189. <dt><b>grass70 -c myvector.shp $HOME/grassdata/mylocation</b>
  190. <dd> Creates new GRASS location based on georeferenced Shapefile
  191. <dt><b>grass70 -c myraster.tif $HOME/grassdata/mylocation</b>
  192. <dd> Creates new GRASS location based on georeferenced GeoTIFF file
  193. </dl>
  194. <h3>Other examples</h3>
  195. There are a variety of ways in which the <i>location environment
  196. variables</i> (see above) can be used to specify the mapset to use.
  197. The following are some possible examples.
  198. <h4>Example 1</h4>
  199. The environment variables are defined as follows:
  200. <div class="code"><pre>
  201. LOCATION = /usr/local/share/grassdata/spearfish60/PERMANENT
  202. GISDBASE = /usr/local/share/grassdata
  203. LOCATION_NAME = spearfish60
  204. MAPSET = PERMANENT
  205. </pre></div>
  206. Start GRASS with the following command:
  207. <div class="code"><pre>
  208. grass70 -
  209. </pre></div>
  210. GRASS will start with the mapset defined by LOCATION since the LOCATION
  211. variable overrides the other variables.
  212. <h4>Example 2</h4>
  213. The environment variables are defined as follows:
  214. <div class="code"><pre>
  215. GISDBASE = /usr/local/share/grassdata
  216. LOCATION_NAME = spearfish60
  217. MAPSET = PERMANENT
  218. </pre></div>
  219. Start GRASS with the following command:
  220. <div class="code"><pre>
  221. grass70 -
  222. </pre></div>
  223. GRASS will start with the mapset defined by
  224. GISDBASE/LOCATION_NAME/MAPSET.
  225. <div class="code"><pre>
  226. grass70 /usr/home/grass/data/thailand/forests
  227. </pre></div>
  228. GRASS will start with the
  229. mapset <tt>/home/grass/data/thailand/forests</tt> which overrides the
  230. environment variables.
  231. <div class="code"><pre>
  232. grass70 swamps
  233. </pre></div>
  234. GRASS will start with the mapset defined by
  235. GISDBASE/LOCATION_NAME/swamps since the command line argument for the
  236. mapset overrides the environment variable MAPSET.
  237. <div class="code"><pre>
  238. grass70 thailand/forests
  239. </pre></div>
  240. GRASS will start with the mapset defined by GISDBASE/thailand/forests
  241. since the command line arguments for the location and mapset overrides
  242. the environment variables LOCATION_NAME and MAPSET.
  243. <h2>CAVEAT</h2>
  244. If you start GRASS using the <em><a href="wxGUI.html">wxGUI</a></em>
  245. interface you must have a <tt>python</tt> command in your $PATH
  246. variable. That is, the command must be named
  247. <tt>python</tt> and not something like <tt>python2.6</tt>. Rarely some
  248. Python installations do not create a <tt>python</tt> command. In these
  249. cases you can override <tt>python</tt> by GRASS_PYTHON environmental
  250. variable.
  251. <p>Furthermore, if you have more than one version of Python installed,
  252. make sure that the version you want to use with GRASS is set by
  253. GRASS_PYTHON environmental variable.
  254. <h2>SEE ALSO</h2>
  255. List of <a href="variables.html">GRASS environment variables</a>
  256. <p>
  257. <a href="http://grass.osgeo.org">GRASS GIS Web site</a><br>
  258. <a href="http://grass.osgeo.org/wiki/">GRASS GIS User Wiki</a><br>
  259. <a href="http://trac.osgeo.org/grass/">GRASS GIS Bug Tracker</a><br>
  260. <a href="http://grass.osgeo.org/programming7/">GRASS GIS 7 Programmer's
  261. Manual</a>
  262. <h2>AUTHORS (of this page)</h2>
  263. Justin Hickey<br>
  264. Markus Neteler<br>
  265. Hamish Bowman<br>
  266. Martin Landa, Czech Technical University in Prague, Czech Republic
  267. <p>
  268. <i>Last changed: $Date$</i>