Merge pull request '# Bugfix: Recalculate_parcels command' (#448) from bugfixing into master
Reviewed-on: #448
This commit is contained in:
commit
acca3a4666
@ -48,11 +48,14 @@ class Command(BaseKonovaCommand):
|
|||||||
"geometry__id",
|
"geometry__id",
|
||||||
flat=True
|
flat=True
|
||||||
)
|
)
|
||||||
|
# ... and resolve into Geometry objects again ...
|
||||||
intersected_geom_objs = Geometry.objects.filter(
|
intersected_geom_objs = Geometry.objects.filter(
|
||||||
id__in=geom_with_intersection_ids
|
id__in=geom_with_intersection_ids
|
||||||
)
|
)
|
||||||
# Filter those geometries out (they have intersections and do not need to be processed)
|
# ... to be able to use the way more efficient difference() function ...
|
||||||
geometry_objects = geometry_objects.difference(intersected_geom_objs)
|
geometry_objects_ids = geometry_objects.difference(intersected_geom_objs).values_list("id", flat=True)
|
||||||
|
# ... so we can resolve these into proper Geometry objects again for further annotation usage
|
||||||
|
geometry_objects = Geometry.objects.filter(id__in=geometry_objects_ids)
|
||||||
|
|
||||||
self._write_warning("=== Update parcels and districts ===")
|
self._write_warning("=== Update parcels and districts ===")
|
||||||
# Order geometries by size to process smaller once at first
|
# Order geometries by size to process smaller once at first
|
||||||
|
Loading…
Reference in New Issue
Block a user