Closed davemfish closed 1 year ago
It would also be super useful to have a study area's data include its spatial extent (bounding box of the union of the parcels).
It would also be super useful to have a study area's data include its spatial extent (bounding box of the union of the parcels).
Actually this may not be necessary at all. It could likely be easily handled by openlayers. The objective being to zoom to the extent of a study area layer.
I think the Parcel
table and StudyArea
table is set up for managing adding / removing a parcel from a study area.
This was resolved in #74
I think some small database refactor (or maybe just new endpoints?) will be useful for managing study areas & their parcels.
Right now, the frontend can get an existing study area and its set of parcels. But it's not so easy to add/remove parcels from that study area. To do so, we are keeping track of the parcel set in react state, and then updating the study area (actually
create_study_area
) with the whole new set of parcels. I think it would be more efficient to have the backend manage more of that, so the frontend could do requests like,/{study_area}/add_parcel
/{study_area}/remove_parcel
This would imply that there is always an active study area. So I think the basic flow of requests from the frontend would be:
get_session
orcreate_session
get_study_areas
- so we can let the user select from existing. And this could probably just get the names, not all the dataget_study_area
(if they selected one) orcreate_study_area
- maybe create it without a name at first, so the user doesn't have to think about that right awayadd_parcel
- which would trigger computing the LULC stats andget_study_area
- so the frontend gets an updated view of all parcels and their stats in the SA.remove_parcel
andget_study_area
, again to get an updated view.update_study_area
- so the user can name it, or rename it anytime - andget_study_area
And if it makes sense to have
add_parcel
andremove_parcel
actually be calls toupdate_study_area
, with associated arguments, that would be fine too.