PostGIS linestrings are compared by bounding boxes instead of actual geometry by default
Sentry Issue: ARKINDEX-BACKEND-3E
Zone.MultipleObjectsReturned: get() returned more than one Zone -- it returned 2!
(9 additional frame(s) were not displayed)
...
File "rest_framework/mixins.py", line 19, in create
self.perform_create(serializer)
File "rest_framework/mixins.py", line 24, in perform_create
serializer.save()
File "rest_framework/serializers.py", line 212, in save
self.instance = self.create(validated_data)
File "arkindex/documents/serializers/elements.py", line 397, in create
File "django/db/models/query.py", line 436, in get
num if not limit or num < limit else 'more than %s' % (limit - 1),
Some Python shell testing shows that the SQL condition added when using a Zone.objects.get(polygon=...)
is WHERE "images_zone"."polygon" ~= ST_GeomFromEWKB('..........'::bytea)
. Before PostGIS 1.5, the ~=
operator did compare exact geometries, but it now only compares by bounding boxes (see the docs).