natcap / urban-online-workflow

This repository hosts the beta implementation of the Urban Online ES Workflow. The project is intended to give urban planners the ability to create and assess scenarios using InVEST Urban models.
1 stars 5 forks source link

managing parcels & study areas in the database #71

Closed davemfish closed 1 year ago

davemfish commented 1 year ago

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:

And if it makes sense to have add_parcel and remove_parcel actually be calls to update_study_area, with associated arguments, that would be fine too.

davemfish commented 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).

davemfish commented 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).

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.

dcdenu4 commented 1 year ago

I think the Parcel table and StudyArea table is set up for managing adding / removing a parcel from a study area.

davemfish commented 1 year ago

This was resolved in #74