WorldHistoricalGazetteer / whg3

Version 3 beta
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

Create/Update Study Area #52

Closed docuracy closed 7 months ago

docuracy commented 1 year ago
docuracy commented 1 year ago

Questions:

docuracy commented 11 months ago

TO DO

KG: "The success url should be /dashboard ...

In v2, a simple polygon hull is computed whether a buffer is requested or not, and its that geometry written to the geojson form field and saved to the Area record. As you have it now, a FeatureCollection appears there. When the page is refreshed as an edit page, a count_public @property on the Area model is consulted to display the number of place records that lie within it. It can’t convert the FeatureCollection in this line: areageom = GEOSGeometry(json.dumps(self.geojson)) But a further issue is, ... what about multiple discontinuous areas making up a study area?"

SG: In areas.js the native MapLibre draw.getAll() method returns a FeatureCollection. We need to extract and merge the feature geometries into a single GeometryCollection, which is now simplified and cleaned by the form validation script in the form class AreaModelForm. It seems that this is the form required for successful conversion to a .wkt which can be used in the geom__within calculation in the model class Area.