actinia-core icon indicating copy to clipboard operation
actinia-core copied to clipboard

Add "tgis" support in actinia for persistent processing and export

Open neteler opened this issue 3 years ago • 6 comments

At time the directory tgis is not yet copied:

https://github.com/mundialis/actinia_core/blob/e1510fce08f8d40d5fc048dc7fd81e920ed5ffc3/src/actinia_core/resources/persistent_processing.py#L477

In addition, the support needs to be added also in some other places:

  • update of mapset name in tgis sqlite.db in persistent part (see t.upgrade and t.downgrade)
  • update mapset name in tgis sqlite.db when creating temporary DB
  • add to exporter (separate from raster export)
    • e.g. netCDF
    • in case, augment also https://grass.osgeo.org/grass-devel/manuals/t.rast.export.html and https://grass.osgeo.org/grass-devel/manuals/t.vect.export.html

For inspiration, see https://redocly.github.io/redoc/?url=https://actinia.mundialis.de/latest/swagger.json#tag/STRDS-Management

neteler avatar May 21 '21 09:05 neteler

Updating the mapset names in the tgis db is not easy: you have to check the current tgis db connection as defined in the <mapset>/VAR file, then use custom SQL commands to update the correct table and most probably some views need to be recreated.

metzm avatar May 26 '21 12:05 metzm

Here a dirty hack to change mapset names in tgis/sqlite.db:

  1. dump SQLite DB, change mapset names on the fly and save to new dump file
  2. restore new dump file as a new tgis/sqlite.db:
/actinia_core/grassdb/geoharmonizer_aq/PERMANENT/tgis # sqlite3 sqlite.db .dump | sed 's+PERMANENT+mymapset+g' > dumpfile
/actinia_core/grassdb/geoharmonizer_aq/PERMANENT/tgis # cat dumpfile | sqlite3 my_database.sqlite

neteler avatar Jun 01 '21 06:06 neteler

Parts are done in #233, but t.rast.extract does not work yet or creating a STRDS from rasters from a previous PC (t.create + t.register) does not work either. For this I have created a new bug ticket in GRASS GIS: https://github.com/OSGeo/grass/issues/1791

anikaweinmann avatar Aug 13 '21 13:08 anikaweinmann

A first step for TGIS support has been done in GRASS with https://github.com/OSGeo/grass/pull/1924 to register maps from a different mapset in a stds in the current mapset.

metzm avatar Oct 05 '21 07:10 metzm

TGIS has been enhanced in GRASS 8.0 to work with maps that are not in the current mapset.

Waiting for a new deployment of actinia for testing.

metzm avatar Mar 21 '22 13:03 metzm