actinia-org / exporter

ace exporter tool (for g.extension)
GNU General Public License v3.0
1 stars 0 forks source link

Is it possible to use `exporter` as stand alone command to export maps outside actinia? #1

Open veroandreo opened 2 years ago

veroandreo commented 2 years ago

Say I'd like to export a map outside actinia. Not the result of a command, but an existing map, e.g. worldpop_2019_1km_aggregated_UNadj within latlong_wgs84/worldpop_south_america. Is this possible? How does it know where to locate the map I'd like to export?

I've tried with ace plus "augmented" syntax as in https://neteler.gitlab.io/actinia-introduction/#example-1-computing-slope-and-aspect-and-univariate-statistics-from-an-elevation-model, but I get the following:

ace location=latlong_wgs84 mapset=worldpop_south_america grass_command="r.mapcalc expression='worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj'"
https://actinia.mundialis.de//api/v1/locations/latlong_wgs84/mapsets/worldpop_south_america/processing_async
{'version': '1', 'list': [{'module': 'r.mapcalc', 'id': 'r.mapcalc_1804289383', 'inputs': [{'param': 'expression', 'value': 'worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj'}, {'param': 'region', 'value': 'current'}]}]}
veroandreo
Resource status accepted
Polling: https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-8a570c47-4973-4cc9-bd3e-ab6b0e19d0c0
Resource poll status: error
AsyncProcessError:  Mapset <worldpop_south_america> exists in the global dataset and can not be modified.
--------------------------------------------------------------------------
{"accept_datetime":"2021-10-18 13:44:37.193191","accept_timestamp":1634564677.1931884,"api_info":{"endpoint":"asyncpersistentresource","method":"POST","path":"/api/v1/locations/latlong_wgs84/mapsets/worldpop_south_america/processing_async","request_url":"http://actinia.mundialis.de/api/v1/locations/latlong_wgs84/mapsets/worldpop_south_america/processing_async"},"datetime":"2021-10-18 13:44:37.326500","exception":{"message":"AsyncProcessError:  Mapset <worldpop_south_america> exists in the global dataset and can not be modified.","traceback":["  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1747, in run\n    self._execute()\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/persistent_processing.py\", line 813, in _execute\n    self._check_lock_target_mapset()\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/persistent_processing.py\", line 454, in _check_lock_target_mapset\n    self._check_target_mapset_exists()\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/persistent_processing.py\", line 435, in _check_target_mapset_exists\n    self.target_mapset_exists = self._check_mapset(self.target_mapset_name)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/persistent_processing.py\", line 386, in _check_mapset\n    raise AsyncProcessError(\n"],"type":"<class 'actinia_core.core.common.exceptions.AsyncProcessError'>"},"http_code":400,"message":"AsyncProcessError:  Mapset <worldpop_south_america> exists in the global dataset and can not be modified.","process_chain_list":[{"list":[{"id":"r.mapcalc_1804289383","inputs":[{"param":"expression","value":"worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj"},{"param":"region","value":"current"}],"module":"r.mapcalc"}],"version":"1"}],"process_log":[],"progress":{"num_of_steps":1,"step":0},"resource_id":"resource_id-8a570c47-4973-4cc9-bd3e-ab6b0e19d0c0","status":"error","time_delta":0.13335680961608887,"timestamp":1634564677.3264356,"urls":{"resources":[],"status":"https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-8a570c47-4973-4cc9-bd3e-ab6b0e19d0c0"},"user_id":"veroandreo"}

ace location=latlong_wgs84 grass_command="r.mapcalc expression='worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj@worldpop_south_america'"
https://actinia.mundialis.de//api/v1/locations/latlong_wgs84/processing_async_export
{'version': '1', 'list': [{'module': 'r.mapcalc', 'id': 'r.mapcalc_1804289383', 'inputs': [{'param': 'expression', 'value': 'worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj@worldpop_south_america'}, {'param': 'region', 'value': 'current'}]}]}
veroandreo
Resource status accepted
Polling: https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-267b14ee-d20c-41f8-bc1d-588c98b354b8
Resource poll status: error
AsyncProcessError:  Error while running executable <r.mapcalc>
--------------------------------------------------------------------------
{"accept_datetime":"2021-10-18 13:46:21.958865","accept_timestamp":1634564781.9588628,"api_info":{"endpoint":"asyncephemeralexportresource","method":"POST","path":"/api/v1/locations/latlong_wgs84/processing_async_export","request_url":"http://actinia.mundialis.de/api/v1/locations/latlong_wgs84/processing_async_export"},"datetime":"2021-10-18 13:46:23.016974","exception":{"message":"AsyncProcessError:  Error while running executable <r.mapcalc>","traceback":["  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1747, in run\n    self._execute()\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing_with_export.py\", line 604, in _execute\n    EphemeralProcessing._execute(self)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1545, in _execute\n    self._execute_process_list(process_list=process_list)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1714, in _execute_process_list\n    self._run_module(process)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1354, in _run_module\n    return self._run_executable(process, poll_time)\n","  File \"/usr/lib/python3.8/site-packages/actinia_core/rest/ephemeral_processing.py\", line 1457, in _run_executable\n    raise AsyncProcessError(\n"],"type":"<class 'actinia_core.core.common.exceptions.AsyncProcessError'>"},"http_code":400,"message":"AsyncProcessError:  Error while running executable <r.mapcalc>","process_chain_list":[{"list":[{"id":"r.mapcalc_1804289383","inputs":[{"param":"expression","value":"worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj@worldpop_south_america"},{"param":"region","value":"current"}],"module":"r.mapcalc"}],"version":"1"}],"process_log":[{"executable":"r.mapcalc","id":"r.mapcalc_1804289383","mapset_size":499,"parameter":["expression=worldpop_2019_1km_aggregated_UNadj+GTiff = worldpop_2019_1km_aggregated_UNadj@worldpop_south_america","region=current"],"return_code":1,"run_time":0.10042953491210938,"stderr":["syntax error","Parse error","ERROR: parse error",""],"stdout":""}],"progress":{"num_of_steps":1,"step":1},"resource_id":"resource_id-267b14ee-d20c-41f8-bc1d-588c98b354b8","status":"error","time_delta":1.0581550598144531,"timestamp":1634564783.0169313,"urls":{"resources":[],"status":"https://actinia.mundialis.de/api/v1/resources/veroandreo/resource_id-267b14ee-d20c-41f8-bc1d-588c98b354b8"},"user_id":"veroandreo"}
veroandreo commented 2 years ago

I'm presented with the same question for the case of importer: is it meant to be used alone? If I run importer raster=bla@my-g-drive/bla.tif (as in the example here: https://neteler.gitlab.io/actinia-introduction/#usage-of-external-data-sources), where would the map be imported into?