Open leendertvanwolfswinkel opened 2 months ago
@leendertvanwolfswinkel Few questions:
"total_rain_mm": 42
paylod for the start processing call comes from? Could you please elaborate it?@benvanbasten-ns I think you created these endpoints, right? Can you help out @ldebek please
Hi @ldebek
1 The method name should be passed in the \process api call. It should either be "dgbc" or "advanced". I changed the API description in this issue
The output format (gpkg or geojson) can also be passed to the API (output_format: gpkg
(default) or geojson
), just like method.
2 total_rain_mm is no longer required.
As for the floor_level. In case the method is "advanced", the buildings geopackage should contain a "floor_level" attribute.
Regarding the floor level column: this is not configurable in the backend. This column with this particular name should be added in the frontend, if necessary.
@benvanbasten-ns Thanks for clarification. I have one more question - is RESULT_ID
in the process endpoint refers to the buildings
result or vulnerable_buildings
?
@ldebek Good question. That refers to the vulnerable_buildings result.
@benvanbasten-ns Thanks - one more request. It seems I don't have an access to the staging Lizard (https://nxt3.staging.lizard.net/) - could you please sort that out for me? 😃
@ldebek I think I can. Did you receive an invitation mail?
@benvanbasten-ns Unfortunately not.
@ldebek And now ?
@benvanbasten-ns Got it - thanks! P.S. Cannot obtain API key
@ldebek Ok, I've given you the right permissions, I think. You should be able to go to https://nxt3.staging.lizard.net/ -> management -> personal api keys
@benvanbasten-ns All works great now - thanks again! :)
Hi @benvanbasten-ns . I have a problem with creating new result for buildings. Getting 403 code during attempt of POST request to https://nxt3.staging.lizard.net/api/v4/scenarios/9b385b9f-2f85-459d-9c2d-0942d78b836a/results/
with {"name": "buildings", "code": "buildings", "family": "Raw"}
data. Response message is: {"status":403,"code":10,"message":"Permission denied. #403.10","detail":"You do not have permission to perform this action."}
Am I missing something or is it just an insufficient access rights issue?
@ldebek Sorry voor de late response. I've changed your permission. I think you should be able to do it now.
@benvanbasten-ns Thanks Ben. I have another question now - is there a way to remove/overwrite previously created 'buildings' result?
EDIT: I was able to call DELETE
method on buildings
result and it's not listed in the scenario results... but while trying to recreate buildings
result I'm getting 400 code with following message: Per scenario, a result's code must be unique.
@ldebek Yes, that's expected behavior. When you delete something, I becomes marked for deletion (and hidden), and will be deleted after X days. Unfortunately, it will remain in the database for that period... I'll check if I can delete it from the DB
@ldebek for which scenario are you trying to recreate the result?
@benvanbasten-ns This one: https://nxt3.staging.lizard.net/api/v4/scenarios/9b385b9f-2f85-459d-9c2d-0942d78b836a/ . Btw. I'm wondering how to best handle case if processing of the buildings fails for some user and user would like to retry whole workflow? Any hints how should it be done to avoid waiting for deleting from DB to happen?
@ldebek I could not find a buildings result in this scenario. Could it be that it has been cleaned up already? Can you try again?
We are currently thinking about ways to avoid the problem you mention.
@leendertvanwolfswinkel @benvanbasten-ns I've implemented requested functionality, with limitation for cases if user want to re-run analysis for the same scenario. Even if plugin is deleting existing buildings
and vulnerable_buildings
results for the scenario, process still will fail with a message saying that those 2 results still exist. In such case user have to wait untill results will be actually deleted on the server and re-run the analysis.
UI
Add a "Flood risk buildings button" to the Simulation results tab
Enable the button if the scenario contains a result with the result code
depth-max-dtri
and/ors1-max-dtri
.When the user clicks the button, show a dialog where they can fill in the following inputs:
depth-max-dtri
. Advanced should be available only when there is as1-max-dtri
resultOK/Cancel buttons
API requests / workflow
Save the selected buildings to a geopackage, in a layer that has a field "floor_level" that is a copy of the column that the user indicated they want to use as floor level.
Create a "buildings" result object for the scenario
The buildings result object for the scenario will now contain an _uploadurl . The building features need to be uploaded to this url:
Create an object to store the outputs to (a "vulnerable buildings" object) for this scenario
Start processingof the vulnerable_buildings result
Track the progress
When the processing is finished
Once the processing is finished, refresh the "downloadable files" list. The vulnerable buildings result should appear in the list