Skip to content

Commit

Permalink
Merge pull request #209 from astrosat/geos-intersects-error-events
Browse files Browse the repository at this point in the history
feat(backend): prevent GEOSIntersects: TopologyException: side location conflict errors
  • Loading branch information
allynt committed Sep 26, 2022
2 parents 633bec4 + 5b28a3a commit 4427770
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/safers/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def name(self):
serial_number = f"S{self.sequence_number:0>5}"

country = Country.objects.filter(
geometry__intersects=self.geometry_collection
# geometry__intersects=self.geometry_collection # TODO: if geometry_collection is malformed can potentially get "GEOSIntersects: TopologyException: side location conflict"
geometry__intersects=self.center
).first()

return "-".join(
Expand Down

0 comments on commit 4427770

Please sign in to comment.