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

Added filtering of stations by variable #94

Closed ricardogsilva closed 3 months ago

ricardogsilva commented 3 months ago

This PR adds information about which observation variables are available for each station, thus enabling the frontend to decide on station visibility depending on the variable that is being focused.

The proposed implementation adds both:

GET http localhost:5001/api/v2/observations/stations?variable_name=TR
{                                
    "features": [                    
        {                              
            "geometry": {...},                      
            "id": "c629b574-2924-40a4-9b49-7f075bf1a246",
            "links": [   
                "http://localhost:5001/api/v2/observations/stations/c629b574-2924-40a4-9b49-7f075bf1a246"
            ],                       
            "properties": {    
                "active_since": "1984-01-01",                                                                                          
                "active_until": null,
                "altitude_m": 1642.0,
                "code": "3",                             
                "monthly_variables": [
                    {                                                                                                                  
                        "id": "e6ed3f91-ccb1-4cd4-ac23-3436f20da98d",
                        "name": "TR"
                    }                        
                ],                                                                                                                     
                "name": "Arabba",                                                                                                      
                "seasonal_variables": [
                    {                 
                        "id": "e6ed3f91-ccb1-4cd4-ac23-3436f20da98d",                                                                  
                        "name": "TR"                                                                                                   
                    }                
                ],       
                "type_": "meteo",
                "yearly_variables": [
                    {                  
                        "id": "2c8b978d-d065-4113-8b9a-7bbfdff2562a",
                        "name": "TDd"                                                                                                  
                    }                                     
                ]
            },
            "type": "Feature"
        },
     ...
  ],
  ...
}