Reputation: 1287
Recently when I tried to create a Polygon instance in Django (version 3.1) I got this error:
GEOSException at / Error encountered checking Geometry returned from GEOS C function "GEOSGeom_createLinearRing_r".
Here's my coordinates that I'm using:
Polygon((51.558994, -0.16349), (51.552505, -0.121468), (51.527564, -0.179695), (51.527564, -0.179695))
These coordinates are just a sample. I'm using Polygon coordinates from the leaflet, but when I try to create django.contrib.gis.geos.polygon.Polygon Instance, I get that error.
Do have any idea or approach to store received coordinate from leaflet to polygon in Django?
Upvotes: 0
Views: 300
Reputation: 15718
Polygon first and last coordinate should be identical ( linear ring )
Upvotes: 2