NASA-IMPACT / covid-dashboard

https://earthdata.nasa.gov/covid19/
Other
20 stars 4 forks source link

Site indicators #184

Open santilland opened 4 years ago

santilland commented 4 years ago

Hello, i'm looking into integrating the API into the trilateral dashboard, and considering what options we have. When i request the sites i get for example one of the sites like this:

  "sites": [
    {
      "id": "be",
      "label": "Beijing",
      "center": [ ... ],
      "polygon": {
        "coordinates": [ ...  ],
        "type": "Polygon"
      },
      "bounding_box": [ ...  ],
      "indicators": []
    },

The indicators seems to always be empty (when requesting all sites), for us to best separate "site data" and "site metadata" requests it would be ideal if we would get the available indicator ids for the site, so for be (Beijing) it would be car-count, no2-15day, xch4, xco2, like this:

"indicators": ["car-count", "no2-15day", "xch4", "xco2"]

Would this be possible? Or is there any other way of getting the available indicator ids inside of a site other then fetching all of the data for that site?

Going even further to be able to only load the selected site and indicator combination, would it be possible to extend the request to allow providing the indicator id? /v1/sites/{site_id}/{indicator_id} I would say this would become important if the datasets become quite larger then they are now, so probably not too important for now.

Thank you for your help!

olafveerman commented 4 years ago

Thanks for these suggestions @santilland. They make a lot of sense.

The empty indicator array was a bug that was addressed. If you go to: https://8ib71h0627.execute-api.us-east-1.amazonaws.com/v1/sites, you should see the available indicators for each site.

Our full attention is currently on next week's launch. After that we'll review the design of the API and take these suggestions into account. Keeping this ticket open so we keep track.

santilland commented 4 years ago

Thanks for looking into it! For now this is exactly what we needed, so the main issue is solved. The api "extension" concept could be considered in the future but does not have any urgency on our side.

olafveerman commented 4 years ago

@santilland Surfacing a PR that aims to improve the discoverability of the API. It doesn't address what you ask for in this issue, but is highly related and may be of interest: https://github.com/NASA-IMPACT/covid-api/pull/46