This adds a new endpoint to query for map cell metadata for a given lat/lon point.
This is intended as the point-based counterpart to the /api/city/{id}/map-cell/ endpoint.
Demo
API results:
Docs:
Notes
It's not great that we have to call ClimateDataCell.objects.map_cell_for_lat_lon once per dataset - I think ideally we'd tighten the relationship between data cell and dataset in a way that would allow getting all map cells regardless of dataset in 1 query. Since we only have 2 datasets right now though, it's not the biggest issue.
Testing Instructions
scripts/update
scripts/server
You should be able to access the /api/map-cell/{lat}/{lon}/ endpoint
When querying for a point that has no data, you should get a 404 response
When querying for a point that has data, you should receive a response for each dataset imported for that point
The docs should be updated to include the new endpoint
Checklist
[x] Does the python linter pass?
[x] Do tests pass?
[x] Has the API documentation been updated, or does this PR not require it?
Overview
This adds a new endpoint to query for map cell metadata for a given lat/lon point. This is intended as the point-based counterpart to the
/api/city/{id}/map-cell/
endpoint.Demo
API results:
Docs:
Notes
It's not great that we have to call
ClimateDataCell.objects.map_cell_for_lat_lon
once per dataset - I think ideally we'd tighten the relationship between data cell and dataset in a way that would allow getting all map cells regardless of dataset in 1 query. Since we only have 2 datasets right now though, it's not the biggest issue.Testing Instructions
scripts/update
scripts/server
/api/map-cell/{lat}/{lon}/
endpointChecklist
Closes #847