Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Why is the following INSERT statement throwing this error?

INSERT INTO domes_place (placeid, structidx, oscode) VALUES ('10', '1', 'POINT(51.121282945772 1.3138398501222)');
psycopg2.IntegrityError: new row for relation "domes_place" violates check constraint "enforce_srid_oscode"

This is the table definition in postgres:

           Table "public.domes_place"
   Column   |          Type          | Modifiers 
------------+------------------------+-----------
 placeid    | integer                | not null
 structidx  | integer                |  
 oscode     | geometry               | 
Check constraints:
    "enforce_dims_oscode" CHECK (st_ndims(oscode) = 2)
    "enforce_geotype_oscode" CHECK (geometrytype(oscode) = 'POINT'::text OR oscode IS NULL)
    "enforce_srid_oscode" CHECK (st_srid(oscode) = 4326)

Isn't this POINT in WGS84 - i.e. in SRID 4326?

share|improve this question

1 Answer 1

Figured it out.

For the benefit of others, the oscode column needed to be specified as follows:

 ST_GeomFromText('POINT(51.146991053359 1.3585857857582)',4326),
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.