Feature: abstract timelapse endpoint #113
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #110
What I did:
I made the
/timelapse
endpoint work for any global, raster dataset (as opposed to justno2-mean
andno2-diff
).How I did it:
I added a field for
datasetId
in the query parameters. The API validate that the dataset indeed a raster dataset.I added a field for
spotlightId
in the query parameters in order to make the/timelapse
endpoint also work with non-global datasets. This functionality is not currently supported by the frontend, since the timelapse requests are generated by drawing a bounding box on the map - which has no knowledge of which "spotlight" it might be over. A potential workaround is for the API to calculate if the bounding box supplied fits within a spotlight's tile, returning an error if it does not. For the time being, the endpoint will only supportglobal
datasets.**Note: the field
month
is nowdate
in order to support both monthly datasets and daily datasetsHow you can test it:
Executing the following query:
returns:
Example of a spotlight-specific dataset query:
returns:
Note the field
spotlightId
in the request.Examples of handled failures:
**Invalid date format: **
returns:
Other handled failures include: