Replies: 4 comments 1 reply
-
The layers buildings-damage-light, buildings-damage-moderate, buildings-damage-heavy represent 3 levels of building damage. These layers are independent of each other in terms of geojson and visualization. Below are examples of possible combinations, Of course, other combinations are allowed. If the concern is that the level of damage is unclear. Then we can use the
POST /api/events/{id}/layers/{name} expects a request body to be in the format, {
"geojson": {
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [ 125.6, 10.1 ] },
"properties": { "name": "Dinagat Islands" }
},
"information": "Supporting information about this event layer."
} but the requests made by upload_event_layers.py send a request body in the format, {
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [ 125.6, 10.1 ] },
"properties": { "name": "Dinagat Islands" }
} The ADA-API looks for a request body with keys I was able to create the layers using the code below to replace lines 24-29 in upload_event_layers.py, layer = layer_file.replace('.geojson', '')
layer_data = json.load(f)
request_body = {}
request_body['geojson'] = layer_data
request_body['information'] = f"Popup Information for layer {layer}"
res = requests.post(f'{host}/api/events/{id}/layers/{layer}', headers=headers, data=json.dumps(request_body)) |
Beta Was this translation helpful? Give feedback.
-
I noticed that The UI will read the value for To fix this, please use, |
Beta Was this translation helpful? Give feedback.
-
Hey @gulfaraz , you probably saw that I uploaded some new events over the weekend. Here's my feedback, we can discuss on Thursday but maybe you can start working on something. It's NOT in order of priority, so feel free to pick from easiest to hardest.
|
Beta Was this translation helpful? Give feedback.
-
POST api/events:
POST api/events/{id}/layers/{name}
<Response [400]> {'message': ['property type should not exist', 'property features should not exist', 'geojson should not be empty', 'information should not be empty', 'information must be a string']}
Beta Was this translation helpful? Give feedback.
All reactions