geobeyond / Arpav-PPCV-backend

Backend di Piattaforma Proiezioni Climatiche per il Nord-Est.
Creative Commons Attribution 4.0 International
0 stars 1 forks source link

API endpoints for querying data #76

Closed ricardogsilva closed 3 months ago

ricardogsilva commented 3 months ago

This PR adds API endpoint for querying coverages.


NOTE

This PR introduces some breaking changes to the DB and therefore needs to be manually deployed in the staging environment.


This new endpoint looks like this:

GET /api/v2/coverages/time-series/{coverage-identifier}?
    coords=POINT(11.5469 44.9524)&
    datetime=../..&
    include_coverage_data=true&
    include_observation_data=true&
    coverage_data_smoothing=LOESS_SMOOTHING&
    observation_data_smoothing=MOVING_AVERAGE_5_YEARS&
    include_coverage_uncertainty=false&
    include_coverage_related_data=false

With the coords and datetime query parameters being mandatory.

Parameters represent the following:

Here is a sample chart generated with matplotlib with data gotten from querying this API endpoint:

Figure 1

Also included in this PR: