One Star

SDI - Shp to postgis example: Insert point to postgis fails

Hello all,
I've tryied the sample of SDI to insert shape features to postgis. All geometries run fine except for the Points. I got this error:
GRAVE: SQL Exception writing geometry columnERROR: new row for relation "_essai_sdi_plop2" violates check constraint "enforce_geotype_the_geom"
The table is created, but empty.
At the creation of the table, SDI wrote this:
ADD CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype("the_geom") = 'POINTM'::text OR "the_geom" IS NULL);
Seems that Postgis is not happy with the check constraint. Something strange is the name of this constrain: 'POINTM' why not 'POINT' ? Is it relevant or not? (I'm not sure to understand what happend behind this check constrain.)
I've tryied the same data with FME into postgis: the resulting geometry was multipoint. So I've tryied with SDI to convert with multipoint geometry:
INFO: ALTER TABLE "public"."_essai_sdi_plop2" ADD CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype("the_geom") = 'MULTIPOINTM'::text OR "the_geom" IS NULL);
This time all attributes are written, but geometries are null.
If someone has any id about what is going on with this sdi sample and point features, that for feedback!
Rémy
1 REPLY
One Star

Re: SDI - Shp to postgis example: Insert point to postgis fails

Sorry Guys, there is a SDI branch in this forum and I did not see it... :-0
I've posted a tread there. Actually I found the solution for this issue. This is a geotools postgis plugin issue: after correcting it and rebuilding all worked fine.