UniStuttgart-VISUS / damast

Code for the DH project "Dhimmis & Muslims – Analysing Multireligious Spaces in the Medieval Muslim World" (VolkswagenFoundation)
MIT License
10 stars 1 forks source link

Behaviour when editing polygons in geographical filtering after they were applied #41

Closed tutebatti closed 2 years ago

tutebatti commented 2 years ago

When multiple polygons were drawn and then applied as geographical filters, using the tools to either move or to remove polygons effects all polygons. This is different with polygons who have not been applied yet. However, reshaping the polygons by either subtraction or moving single points works both before and after applying the filters.

If this is a bug related to the Leaflet plugin for Geoman and not easily corrected by us ourselves, I suggest to leave it as is and just indicate the problem in the info text.

mfranke93 commented 2 years ago

This is not a bug. Rather, it is a limitation I built in knowingly, or accepted as such.

At the core of this is the fact that, to communicate the filter between frontend and server, to store it in the state, and to use it for report generation (happens in the backend), a standard format was needed. GeoJSON seemed the obvious choice. The Geoman plugin can produce GeoJSON, and import it, but internally uses something else. For instance, GeoJSON does not have the concept of a circle, so on export from Geoman, the circles are converted to polygons. Rectangles are also converted to four-sided polygons. This is why, when editing freshly, circle radius can be changed and rectangle width and height can be changed, but after saving, only "normal" polygon editing functionality is available. In the same vein, all polygons in the filter are merged into one GeoJSON Feature on export. When loading back into Geoman, it consequently interprets those as one feature, and so individual moving is no longer possible.

It would be possible to tweak this, but frankly I don't (and didn't at the time of implementation) see any valid use case for

  1. creating multiple polygons,
  2. saving the filter, and then
  3. wanting to move one of them.

Please let me know if this is something you would need.

tutebatti commented 2 years ago

Thanks for clarification. I agree that the need to use multiple polygons is rather limited. As I said, it will suffice to indicate the behaviour in the info text.