Open ChrisJones687 opened 5 years ago
Potential library for this https://github.com/bjornharrtell/jsts/tree/master/contrib/jsts-bundler
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.
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.