outbreak-info / biothings_covid19

Biothings plugin for JHU CSSE COVID-19 cases
6 stars 5 forks source link

Store geojson of the locations on the ES index #17

Closed flaneuse closed 4 years ago

flaneuse commented 4 years ago

See outbreak-info/outbreak.info#134

Currently, the choropleths at outbreak.info/maps are loaded as geojsons by the front-end and then merged with the result of an API call client-side. Obviously, this puts a load on the front-end, and the join can't be cached for subsequent calls.

  1. Investigate the performance hit on the API by storing this additional info on the backend and the query time on the front-end vs. the current behavior.
  2. If it looks good: add the geojsons for each region to every data point.
  3. Adjust the front-end to query rather than run the join client-side.
gkarthik commented 4 years ago

Would attaching a geoJSON record to every record at all admin levels on the api along with outbreak-info/outbreak.info#133 fix this issue?

flaneuse commented 4 years ago

Yep, that's the idea! I just don't know if the retrieval time of each geojson is faster than loading the geojson once on the front-end and then doing a front-end join. i assume so...

gkarthik commented 4 years ago

Fixed by https://github.com/outbreak-info/biothings_covid19/commit/92f1f8f324d4d40dd9143db7e3fa6ad63dc9323e