Skip to content

Commit e3dd53a

Browse files
committed
add first STRDS docs
1 parent 81a2568 commit e3dd53a

1 file changed

Lines changed: 109 additions & 2 deletions

File tree

docs/docs/06_raster_vector_strds_managment.md

Lines changed: 109 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,125 @@ mapset_name = "test_mapset"
7171
# mapset creation
7272
locations["nc_spm_08"].create_mapset(mapset_name)
7373
74-
# upload tif
74+
# Upload GeoJSON
7575
vector_layer_name = "test"
7676
file = "/home/testuser/data/firestations.geojson"
7777
locations["nc_spm_08"].mapsets[mapset_name].upload_vector(vector_layer_name, file)
7878
print(locations["nc_spm_08"].mapsets[mapset_name].vector_layers.keys())
7979
```
8080

81-
Delete a raster layer
81+
Delete a vector layer
8282
```
8383
locations["nc_spm_08"].mapsets[mapset_name].delete_vector(vector_layer_name)
8484
print(locations["nc_spm_08"].mapsets[mapset_name].vector_layers.keys())
8585
8686
# delete mapset
8787
locations["nc_spm_08"].delete_mapset(mapset_name)
8888
```
89+
90+
## Space-Time-Raster-Dataset (STRDS) management
91+
92+
Create a new, empty STRDS and register raster maps
93+
(here the user mapset will be created before)
94+
95+
```
96+
strds_name = "test_strds"
97+
98+
# Create mapset
99+
mapset_name = "test_strds_mapset"
100+
locations["ECAD"].create_mapset(mapset_name)
101+
102+
# Create new STRDS
103+
locations["ECAD"]
104+
.mapsets[mapset_name]
105+
.create_strds(
106+
strds_name,
107+
"Title of the STRDS",
108+
"Longer description description of the STRDS",
109+
"absolute", # temporal type of the STRDS
110+
)
111+
112+
# Register raster maps in STRDS
113+
locations["ECAD"]
114+
.mapsets[mapset_name]
115+
strds[strds_name].register_raster_layers(
116+
[
117+
{
118+
"name": "precipitation_yearly_mm_0@PERMANENT",
119+
"start_time": "1951-01-01 00:00:00",
120+
"end_time": "1952-01-01 00:00:00",
121+
},
122+
{
123+
"name": "precipitation_yearly_mm_1@PERMANENT",
124+
"start_time": "1952-01-01 00:00:00",
125+
"end_time": "1953-01-01 00:00:00",
126+
},
127+
{
128+
"name": "precipitation_yearly_mm_2@PERMANENT",
129+
"start_time": "1953-01-01 00:00:00",
130+
"end_time": "1954-01-01 00:00:00",
131+
},
132+
],
133+
)
134+
```
135+
136+
Get STRDS metadata and list raster maps
137+
138+
```
139+
# Get general info
140+
locations["ECAD"]
141+
.mapsets[mapset_name]
142+
strds[strds_name].get_info()
143+
144+
# Get selected, registered raster maps
145+
locations["ECAD"]
146+
.mapsets[mapset_name]
147+
strds[strds_name].get_strds_raster_layers(
148+
where="start_time >= '1952-01-01 00:00:00'"
149+
)
150+
```
151+
152+
Sample STRDS at point locations
153+
154+
```
155+
locations["ECAD"]
156+
.mapsets[mapset_name]
157+
strds[strds_name].sample_strds(
158+
[["id", ,y], ["id",x,y]]
159+
)
160+
```
161+
162+
Compute univariate statistics for areas over an STRDS
163+
164+
```
165+
locations["ECAD"]
166+
.mapsets[mapset_name]
167+
strds[strds_name].compute_strds_statistics(
168+
169+
)
170+
```
171+
172+
Render STRDS
173+
174+
```
175+
locations["ECAD"]
176+
.mapsets[mapset_name]
177+
strds[strds_name].render(
178+
{
179+
"n": ,
180+
"s": ,
181+
"e": ,
182+
"w": ,
183+
"width": 800,
184+
"height": 600,
185+
"start_time": "1952-01-01 00:00:00",
186+
"end_time": "1954-01-01 00:00:00",
187+
}
188+
)
189+
```
190+
191+
192+
193+
```
194+
# https://actinia.mundialis.de/latest/locations/ECAD/mapsets/PERMANENT/strds/precipitation_1950_2013_yearly_mm
195+
```

0 commit comments

Comments
 (0)