ncsu-landscape-dynamics / PoPS-Forecasting-Platform

Django backend and API powering popsmodel.org
GNU General Public License v3.0
3 stars 0 forks source link

Budget increases when management overlaps or is out of model bounds #3

Open ChrisJones687 opened 5 years ago

ChrisJones687 commented 5 years ago

This is can be resolved currently in the backend but would ultimately we want to handle this on the frontend so that the user gets more accurate feedback.

ChrisJones687 commented 4 years ago

Potential library for this https://github.com/bjornharrtell/jsts/tree/master/contrib/jsts-bundler

shannonkjones commented 4 years ago

There are two ways we could approach this.

(1) On the frontend (in the browser). In that case, I think we should bring in turf.js. It has a cleanCoords and bboxClip method that I think will handle the overlapping management and the out of model bounds issues.

(2) On the backend (in the Django view). If we're going to be using web sockets to draw management and update the database in real time, then this could happen on the Django backend. In that case, the polygons could be cleaned up in python on the server before being passed back to the client. This might be preferable since there is already so much happening on the client side.