#138 WIP Validity

* adds geometry validity checks for SimpleGeomForm is_valid()
    * shows validity problems on the form if a feature is invalid
* optimizes merging of different features into one MultiPolygon
* further enhances tests
* adds as_feature_collection() method on Geometry model for converting geom MultiPolygon attribute into FeatureCollection json holding each polygon as an own feature -> makes each polygon selectable in new netgis map client
This commit is contained in:
2022-04-20 13:52:52 +02:00
parent c60afb0391
commit 253b509122
4 changed files with 61 additions and 18 deletions

View File

@@ -128,6 +128,7 @@ class CompensationWorkflowTestCase(BaseWorkflowTestCase):
new_identifier = self.create_dummy_string()
new_comment = self.create_dummy_string()
new_geometry = MultiPolygon(srid=4326) # Create an empty geometry
geojson = self.create_geojson(new_geometry)
check_on_elements = {
self.compensation.title: new_title,
@@ -142,7 +143,7 @@ class CompensationWorkflowTestCase(BaseWorkflowTestCase):
"title": new_title,
"intervention": self.intervention.id, # just keep the intervention as it is
"comment": new_comment,
"geom": new_geometry.geojson,
"geom": geojson,
}
self.client_user.post(url, post_data)
self.compensation.refresh_from_db()