Felix Delattre (c3023e57) at 10 Aug 19:18
Felix Delattre (c3023e57) at 10 Aug 19:18
Added endpoint to query buildings by bounding box
Added simple endpoint to query buildings by bbox.
\approve @prehn
I prefer _by_bbox
as more general wording that can also be used for _by_ids
, _by_whatever
. Particularily as this is an API endpoint and a generic structure helps in such overviews.
This building is not getting deleted, because it is part of the mocked-up testing db. We run tests against this, instead of a live database.
async def get_buildings_in_bbox(xmin, ymin, xmax, ymax) -> dict:
The building with this ID may be deleted at any time. This could cause the test to fail. I have no solution for this problem but it should be documented so that in case of a later failure the cause will be immediately clear and the test can be fixed.
Looking good to me, no other questions.
Added simple endpoint to query buildings by bbox.
\approve @prehn
Now tests run through as well. This is ready for your review, @prehn. Thanks!
(1) It just gives an empty dictionary as defined a in line 85. The program doesn't crash on line 87.
>>> request("http://localhost:5000/v1", "get_building", "0").data.result
{'building': {}}
(2) It waits until it gets an answer to result
before continuing.
Felix Delattre (c3023e57) at 10 Aug 16:46
Added endpoint to query buildings by bounding box
Two questions here
(1) Does the query always return something or could this also return None
or a similar non-iterable object in which case the code would throw an exception later on (e.g. line 87).
(2) Since this is an asynchronous call, is it possible to happen that the result
variable is not yet set (because the callback takes longer or so) and thus the code would crash at line 87?
Added simple endpoint to query buildings by bbox.
\approve @prehn
Felix Delattre (2d1a3470) at 09 Aug 17:12
Added endpoint to query buildings by bounding box
Felix Delattre (cb0a3702) at 09 Aug 17:01
Added endpoint to query buildings by bounding box
Felix Delattre (3033592b) at 09 Aug 17:01
Added endpoint to query buildings by bounding box
Felix Delattre (94eceb5b) at 09 Aug 17:01
Added endpoint to query buildings by bounding box
Felix Delattre (6757a354) at 09 Aug 17:01
Added endpoint to query buildings by bounding box
Felix Delattre (c14f0e1c) at 09 Aug 17:00
Added endpoint to query buildings by bounding box