NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Make changes to spatial bounds for campaigns and deployments #438

Closed heidimok closed 1 year ago

heidimok commented 1 year ago

Context

CASEI was built with the assumption that spatial bounds would exist for every campaign. In the case of the AASE campaign, that assumption changed because we couldn’t find information about spatial bounds. This resulted in a build failure.

Discussed Options

Decision

  1. Add requirement to the spatial bounds in the MI so that curators must input spatial bounds for campaigns and deployments
  2. If the spatial bounds are not identified, set default coordinates to include the whole world
  3. Whenever a deployment is added or changed, automatically update the spatial bounds of the campaign to include the new spatial bounds so that a curator doesn’t have to update it manually.

Updated Decisions (updated Mar 7, 2023)

smwingo commented 1 year ago

only addition/really clarification i have: under "Decision" #3 - Whenever a deployment is added or changed, automatically updated the spatial bounds for the campaign:

if campaign bounds not originally entered, and campaign form is saved with default/whole world bounds, when curator adds a deployment (or multiple deployments) and the specific bounds for that deployment(s - which the spatial bounds need to required separately for each deployment) the campaign spatial bounds need to automatically update to be the inclusive set of all deployment spatial bounds.

A more ideal scenario would be for the campaign bounds to be the set of the separate deployment domains, but i'm not sure how this would be in implementation since most campaigns will have a single deployment but some have lots of deployments -- perhaps need to have discussion also on:

heidimok commented 1 year ago

Sharing the result below:

Screen Shot 2023-02-09 at 12 45 57 PM Screen Shot 2023-02-09 at 12 46 15 PM

Changes:

heidimok commented 1 year ago

Will put task 2 for this as a Sprint 3 goal.

CarsonDavis commented 1 year ago

@smwingo @edkeeble @alukach @naomatheus

Previous Discussions

So, reading over what has been discussed so far:

Current Situation

So, overview from the current situation on the database:

Potential Update

So, one possible option is to:

Challenges

This solves all the front end issues, but has some curator and migration challenges.

Future Curation

alukach commented 1 year ago

Thanks @CarsonDavis . We discussed this during our Feb 9 meeting (you may have been away).

image

My memory of the take-aways was:

  1. Deployments currently have optional spatial_bounds attributes. This is good. Sometimes curators don't have spatial bounds for a deployment and we don't want to block them.
  2. Campaigns currently have optional spatial_bounds attributes. We should remove this field and only care about the spatial bounds of the deployments.
  3. Logic around aggregating deployment spatial bounds and handling deployments without spatial bounds should take place on the frontend. No need for the backend to enforce any logic (e.g. default to the whole world) as this is a false representation of what we know. When the frontend encounters a campaign with no related deployment spatial bounds, it will render a map with no polygons and display a message stating something along the lines of "we don't know the spatial bounds".

Regarding Carson's questions about migrating, I think we should discard the values from Campaign.spatial_bounds. I think those were always a human-generated aggregate of the deployment's spatial bounds (I could be wrong on this) so nothing of true value would be lost.

heidimok commented 1 year ago

Can we take a look to see this issue in the backlog https://github.com/NASA-IMPACT/admg-backend/issues/261 get closed as a result of the changes in this issue?