[postgis-users] adding additional points to multipoint

Markus Schaber schabi at logix-tt.com
Fri Mar 31 03:53:01 PST 2006


Hi, Christo,

Christo Du Preez wrote:
> Thank you,
> 
> When trying
> update meclabel
> set the_geom = geomunion(the_geom, GeomFromText('POINT(23 4)', -1))
> 
> I get:: ERROR:  new row for relation "meclabel" violates check
> constraint "enforce_geotype_the_geom"

Hmm, I did not cast it in my tests, but I guess that, depending on your
PostGIS version, Geomunion might return a GeometryCollection instead of
an MultiPoint.

Can you see what PostGIS version you have?

Can you execute

 select asText(geomunion('MULTIPOINT(1 1,3 3)',
  geomFromText('POINT(2 2)',-1)));

and tell us its output?


>  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
> 'MULTIPOINT'::text OR the_geom IS NULL),

This is the "guilty" constraint that blocks all non-multipoint
geometries from being inserted into the table.

Markus
-- 
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org



More information about the postgis-users mailing list