-
Notifications
You must be signed in to change notification settings - Fork 0
/
ace.html
215 lines (164 loc) · 5.85 KB
/
ace.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<h2>DESCRIPTION</h2>
<em><b>ace</b></em> - actinia command execution
(<a href="https://actinia.mundialis.de">https://actinia.mundialis.de</a>).
<p>
The ace tool allows the execution of a single GRASS GIS command or
a list of GRASS GIS commands on an actinia REST service
(<a href="https://actinia.mundialis.de/">https://actinia.mundialis.de/</a>).
In addition it provides job management, the ability to list locations,
mapsets and map layer the user has access to as well as the creation
and deletion of mapsets.
<p>
The ace tool must be executed in an active GRASS GIS session and
will use the current location of this session to access the actinia service.
<h2>NOTES</h2>
The <em>ace</em> tool allows the execution of single GRASS GIS command
or a list of GRASS GIS commands on an actinia REST service. In addition
it provides job management and the ability to list locations, mapsets
and map layer the user has access to.
<p>
This tool must be executed in an active GRASS GIS session
<!--
and will use the current location to access the actinia service. The current location can
be overwritten
-->
specified by the <b>location</b> option. All commands will be executed
per default in an ephemeral database, hence generated output must be
exported using augmented GRASS commands. The flag <b>-p</b> allows the
execution of commands in the persistent user database. It should be used
with <b>location</b> option.
<p>
The user must setup the following environmental variables to specify the
actinia server and credentials (example):
<div class="code"><pre>
export ACTINIA_USER='demouser'
export ACTINIA_PASSWORD='gu3st!pa55w0rd'
export ACTINIA_URL='https://actinia.mundialis.de'
export ACTINIA_VERSION='v3'
</pre></div>
<p>
This tool takes a GRASS GIS command as argument (<em>grass_command</em>).
In addition, there are options to:
<ol>
<li>execute a list of commands from an input script file.</li>
<li>perform job management on the actinia server (list, info, kill)</li>
<li>show the version of the actinia service</li>
<li>show the locations and mapsets the user has access to</li>
<li>show map layers of specific location/mapset</li>
<li>create new persistent user specific locations</li>
<li>create new persistent user specific mapsets</li>
</ol>
GRASS GIS commands can be augmented with actinia specific extensions. The
<b>@</b> operator can be specified for an input parameter to import a web
located resource and to specify the export of an output parameter.
<h2>EXAMPLES</h2>
<!--
Single command example:
<div class="code"><pre>
ace grass_command="g.list raster"
</pre></div>
-->
Single command example with location option:
<div class="code"><pre>
ace grass_command="g.list raster" location="nc_spm_08"
</pre></div>
The following commands from a script will import a raster layer from an
internet source as raster map "elev", sets the computational region to the
map and computes the slope. Additional information about the raster layer
are requested with <em>r.info</em> (save as text file <em>commands.sh</em>):
<div class="code"><pre>
# Import the web resource and set the region to the imported map
g.region raster=elev@https://storage.googleapis.com/graas-geodata/elev_ned_30m.tif -ap
# Compute univariate statistics
r.univar map=elev
r.info elev
# Compute the slope of the imported map and export it as Cloud Optimized GeoTIFF
r.slope.aspect elevation=elev slope=slope_elev+COG
r.info slope_elev
</pre></div>
<!--
<p>
Run the script <em>commands.sh</em> in the current location on the actinia server:
<div class="code"><pre>
ace script="commands.sh"
</pre></div>
-->
<p>
Run the script <em>commands.sh</em> in the location "nc_spm_08" on the actinia
server:
<div class="code"><pre>
ace location="nc_spm_08" script="commands.sh"
</pre></div>
<p>
List all running jobs of the current user:
<div class="code"><pre>
ace list-jobs="running"
</pre></div>
<p>
Get information about a specific job:
<div class="code"><pre>
ace info-job="resource_id-3ce07606-cc77-4188-942e-5a5fbc8f1091"
</pre></div>
<p>
Kill a running job:
<div class="code"><pre>
ace kill-job="resource_id-3ce07606-cc77-4188-942e-5a5fbc8f1091"
</pre></div>
<p>
List all locations the user has access to:
<div class="code"><pre>
ace -l
</pre></div>
<p>
List all mapsets in the specified location the user access to:
<div class="code"><pre>
ace -m location="nc_spm_08"
</pre></div>
<p>
List all raster maps in mapset "PERMANENT" of the location "nc_spm_08":
<div class="code"><pre>
ace location="nc_spm_08" mapset="PERMANENT" -r
</pre></div>
<p>
List all vector maps in mapsets PERMANENT of the location "nc_spm_08":
<div class="code"><pre>
ace location="nc_spm_08" mapset="PERMANENT" -v
</pre></div>
<p>
List all strds in mapsets PERMANENT of the location "nc_spm_08":
<div class="code"><pre>
ace location="nc_spm_08" mapset="PERMANENT" -s
</pre></div>
<p>
Create a new location "test_location" in the persistent user database:
<div class="code"><pre>
ace create-location="test_location 4326"
</pre></div>
<p>
Delete "test_location" from the persistent user database:
<div class="code"><pre>
ace delete-location="test_location"
</pre></div>
<p>
Create a new mapset in location "nc_spm_08" in the persistent user database:
<div class="code"><pre>
ace location="nc_spm_08" create_mapset="test_mapset"
</pre></div>
<p>
Delete "test_mapset" mapset from location "nc_spm_08" in the persistent user
database:
<div class="code"><pre>
ace location="nc_spm_08" delete_mapset="test_mapset"
</pre></div>
<p>
Run command <em>g.list</em> in the persistent user database in location "nc_spm_08"
mapset "test_mapset":
<div class="code"><pre>
ace location="nc_spm_08" mapset="test_mapset" grass_command="g.list type=raster mapset=test_mapset"
</pre></div>
<h2>AUTHORS</h2>
Soeren Gebbert
<p>
Original source: https://github.com/mundialis/actinia_core/blob/master/scripts/ace
<p>
GRASS GIS parser support: Markus Neteler, <a href="https://www.mundialis.de">mundialis</a>, Germany