Skip to content

Commit

Permalink
init: renaming location to project for grass.py init script (#3670)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa committed Apr 27, 2024
1 parent 4ba6eae commit a02702a
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 94 deletions.
91 changes: 46 additions & 45 deletions lib/init/grass.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ <h2>SYNOPSIS</h2>
<b>grass</b> [<b>-h</b> | <b>-help</b> | <b>--help</b>] [<b>-v</b> | <b>--version</b>] |
[<b>-c</b> | <b>-c geofile</b> | <b>-c EPSG:code[:datum_trans]</b>] | <b>-e</b> | <b>-f</b> |
[<b>--text</b> | <b>--gtext</b> | <b>--gui</b>] | <b>--config</b> |
[<b>--tmp-location</b> | <b>--tmp-mapset</b>]
[[[<b>&lt;GISDBASE&gt;/</b>]<b>&lt;LOCATION&gt;/</b>]
[<b>--tmp-project</b> | <b>--tmp-mapset</b>]
[[[<b>&lt;GISDBASE&gt;/</b>]<b>&lt;PROJECT&gt;/</b>]
<b>&lt;MAPSET&gt;</b>]
[<b>--exec EXECUTABLE</b>]

Expand All @@ -20,20 +20,20 @@ <h3>Flags:</h3>
<dt><b>-v</b> | <b>--version</b>
<dd> Prints the version of GRASS and exits

<dt><b>-c</b>
<dd> Creates new GRASS unprojected location in specified GISDBASE
<dt><b>-c XY</b>
<dd> Creates new GRASS project (location) without coordinate reference system in specified GISDBASE

<dt><b>-c geofile</b>
<dd> Creates new GRASS projected location in specified GISDBASE based on georeferenced file
<dd> Creates new GRASS project in specified GISDBASE with coordinate reference system based on georeferenced file

<dt><b>-c EPSG:code</b>
<dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code
<dd> Creates new GRASS project in specified GISDBASE with coordinate reference system defined by EPSG code

<dt><b>-c EPSG:code:datum_trans</b>
<dd> Creates new GRASS projected location in specified GISDBASE with given EPSG code and datum transform parameters
<dd> Creates new GRASS project in specified GISDBASE with coordinate reference system defined by EPSG code and datum transform parameters

<dt><b>-e</b>
<dd> Exit after creation of location or mapset. Only with <b>-c</b> flag
<dd> Exit after creation of project or mapset. Only with <b>-c</b> flag

<dt><b>-f</b>
<dd> Forces removal of .gislock if exists (use with care!). Only with --text flag
Expand All @@ -54,15 +54,15 @@ <h3>Flags:</h3>
<dt><b>--exec EXECUTABLE</b>
<dd> Execute GRASS module or script. The provided executable will be executed in a GRASS GIS non-interactive session.

<dt><b>--tmp-location</b>
<dd> Run using a temporary location which is created based on the given
<dt><b>--tmp-project</b>
<dd> Run using a temporary project which is created based on the given
coordinate reference system and deleted at the end of the execution
(use with the --exec flag).
The active mapset will be the PERMANENT mapset.

<dt><b>--tmp-mapset</b>
<dd> Run using a temporary mapset which is created in the specified
location and deleted at the end of the execution
project and deleted at the end of the execution
(use with the --exec flag).

</dl>
Expand All @@ -74,20 +74,21 @@ <h3>Parameters:</h3>
<dd> Initial database directory which should be a fully qualified path
(e.g., <tt>/usr/local/share/grassdata</tt>)

<dt><b>LOCATION</b>
<dd> Initial location directory which is a subdirectory of GISDBASE
<dt><b>PROJECT</b>
<dd> Initial project directory which is a subdirectory of GISDBASE
(project was previously called location)

<dt><b>MAPSET</b>
<dd> Initial mapset directory which is a subdirectory of LOCATION
<dd> Initial mapset directory which is a subdirectory of PROJECT
</dl>

<i>Note</i>: These parameters must be specified in one of the
following ways:

<div class="code"><pre>
MAPSET
LOCATION/MAPSET
GISDBASE/LOCATION/MAPSET
PROJECT/MAPSET
GISDBASE/PROJECT/MAPSET
</pre></div>

<h2>DESCRIPTION</h2>
Expand Down Expand Up @@ -141,7 +142,7 @@ <h3>Config flag</h3>
<h2>SAMPLE DATA</h2>

The GRASS GIS project provides several free sample geospatial datasets
as ready-to-use locations. They are available to download at
as ready-to-use projects. They are available to download at
<a href="https://grass.osgeo.org/download/sample-data/">https://grass.osgeo.org/download/sample-data/</a>.

The "North Carolina data set" is a modern package of geospatial data from
Expand Down Expand Up @@ -247,48 +248,48 @@ <h2>EXAMPLES</h2>
<dl>
<dt><b>grass</b>
<dd> Start GRASS using the default user interface. The user will be
prompted to choose the appropriate location and mapset.
prompted to choose the appropriate project and mapset.

<dt><b>grass --gui</b>
<dd> Start GRASS using the graphical user interface. The user will be
prompted to choose the appropriate location and mapset.
prompted to choose the appropriate project and mapset.

<dt><b>grass --text</b>
<dd> Start GRASS using the text-based user interface. Appropriate
location and mapset must be set by environmental variables (see
project and mapset must be set by environmental variables (see
examples below) otherwise taken from the last GRASS session.</dd>

<dt><b>grass --gtext</b>
<dd> Start GRASS using the text-based user interface. The user will be
prompted to choose the appropriate location and mapset.
prompted to choose the appropriate project and mapset.

<dt><b>grass $HOME/grassdata/spearfish70/user1</b>
<dd> Start GRASS using the default user interface and automatically
launch into the given mapset, bypassing the mapset selection menu.

<dt><b>grass --gui -</b>
<dd> Start GRASS using the graphical user interface and try to
obtain the location and mapset from environment variables.
obtain the project and mapset from environment variables.

<dt><b>grass -c EPSG:4326 $HOME/grassdata/mylocation</b>
<dd> Creates a new GRASS location with EPSG code 4326 (latitude-longitude, WGS84)
<dt><b>grass -c EPSG:4326 $HOME/grassdata/myproject</b>
<dd> Creates a new GRASS project with EPSG code 4326 (latitude-longitude, WGS84)
in the specified GISDBASE

<dt><b>grass -c EPSG:5514:3 $HOME/grassdata/mylocation</b>
<dd> Creates a new GRASS location with EPSG code 5514 (S-JTSK / Krovak
<dt><b>grass -c EPSG:5514:3 $HOME/grassdata/myproject</b>
<dd> Creates a new GRASS project with EPSG code 5514 (S-JTSK / Krovak
East North - SJTSK) with datum transformation parameters used in
Czech Republic in the specified GISDBASE

<dt><b>grass -c XY $HOME/grassdata/gnomonic --exec g.proj -c proj4='+proj=gnom +lat_0=90 +lon_0=-50'</b>
<dd> Creates a new GRASS location from PROJ definition string
<dd> Creates a new GRASS project from PROJ definition string
(here: <a href="https://proj4.org/operations/projections/gnom.html">gnomonic</a>)
in the specified GISDBASE

<dt><b>grass -c myvector.shp $HOME/grassdata/mylocation</b>
<dd> Creates a new GRASS location based on georeferenced Shapefile
<dt><b>grass -c myvector.shp $HOME/grassdata/myproject</b>
<dd> Creates a new GRASS project based on georeferenced Shapefile

<dt><b>grass -c myraster.tif $HOME/grassdata/mylocation</b>
<dd> Creates a new GRASS location based on georeferenced GeoTIFF file
<dt><b>grass -c myraster.tif $HOME/grassdata/myproject</b>
<dd> Creates a new GRASS project based on georeferenced GeoTIFF file
</dl>

<h3>Batch jobs with the exec interface</h3>
Expand All @@ -300,7 +301,7 @@ <h3>Batch jobs with the exec interface</h3>
Region issues ignored.
-->

Creating a new Location based on a geodata file's projection (<b>-c</b>)
Creating a new project based on a geodata file's projection (<b>-c</b>)
and exit (<b>-e</b>) immediately:

<div class="code"><pre>
Expand Down Expand Up @@ -374,53 +375,53 @@ <h4>Execution of shell and Python scripts instead of single commands</h4>
print(vector)
</pre></div>

<h4>Using temporary location</h4>
<h4>Using temporary project</h4>

Creating a new temporary location based on a georeferenced file's
projection coordinate reference system (CRS) and simultaneously starting
Creating a new temporary project based on a georeferenced file's
coordinate reference system (CRS) and simultaneously starting
computation in a shell script:

<div class="code"><pre>
grass --tmp-location elevation.tiff --exec test.sh
grass --tmp-project elevation.tiff --exec test.sh
</pre></div>

The same, but using an EPSG code and a Python script:

<div class="code"><pre>
grass --tmp-location EPSG:3358 --exec test.py
grass --tmp-project EPSG:3358 --exec test.py
</pre></div>

Finally, for special cases, we can create an XY location without any CRS:
Finally, for special cases, we can create an XY project without any CRS:

<div class="code"><pre>
grass --tmp-location XY --exec test.py
grass --tmp-project XY --exec test.py
</pre></div>

Temporary location is automatically deleted after computation,
Temporary project is automatically deleted after computation,
so the script is expected to export, link or otherwise preserve the
output data before ending.

<p>
A single command can be also executed, e.g. to examine properties of the
temporary location:
temporary project:

<div class="code"><pre>
grass --tmp-location EPSG:3358 --exec g.proj -p
grass --tmp-project EPSG:3358 --exec g.proj -p
</pre></div>

A temporary XY location with single command is useful, e.g. to show
A temporary XY project with single command is useful, e.g. to show
help text of a module:

<div class="code"><pre>
grass --tmp-location XY --exec r.neighbors --help
grass --tmp-project XY --exec r.neighbors --help
</pre></div>


<h4>Using temporary mapset</h4>

<p>
A single command can be executed, e.g., to examine properties of a
location (here using the NC SPM sample location):
project (here using the NC SPM sample dataset):

<div class="code"><pre>
grass --tmp-mapset /path/to/grassdata/nc_spm_08/ --exec g.proj -p
Expand Down

0 comments on commit a02702a

Please sign in to comment.