I'm using GeoDjango and have a Django model with a PointField:
class ArchivrItem(models.Model):
...
coordinate = models.PointField(srid=4326)
When I try to insert a new ArchivrItem, using latitude and longitude, I get this error:
ERROR: new row for relation "archivr_archivritem" violates check constraint "enforce_srid_coordinate"
I can avoid Django and get the same error in postgresql directly by trying to do this:
INSERT INTO archivr_archivritem (coordinate) VALUES ('POINT(51.520667 -0.094833)');
I'm probably being naive and ignorant around SRID and point systems... what am I missing? Thanks.
UPDATE: I should add what the constraint is. The constraints on the table are:
"enforce_dims_coordinate" CHECK (st_ndims(coordinate) = 2)
"enforce_geotype_coordinate" CHECK (geometrytype(coordinate) = 'POINT'::text OR coordinate IS NULL)
"enforce_srid_coordinate" CHECK (st_srid(coordinate) = 4326)