[postgis-users] ERROR: new row for relation "x" violates checkconstraint "enforce_geotype_the_geom"
Obe, Regina
robe.dnd at cityofboston.gov
Thu Aug 9 04:25:37 PDT 2007
In addition to what Frank mentioned. Often times Geomunion applied to polygons or multipolygons may return a Polygon rather than a MultiPolygon.
To force it into a multipolygon type, wrap a multi call around it. Something like
select t1.gid,multi(geomunion(t1.the_geom, t2.the_geom))
from gf_veg1 t1, gf_veg2 t2;
-----------------------------------
Also why are you doing a cartesian join?
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Frank Koormann
Sent: Thursday, August 09, 2007 6:04 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ERROR: new row for relation "x" violates checkconstraint "enforce_geotype_the_geom"
Hi again,
* Andreas Laggner <bloediandi at web.de> [070809 11:21]:
> i have to delete this constraint in EVERY table i want to write to! I
> think that is not normal?!
Partly - yes:
- AddGeometryColumn creates a contraint according to the geometry type
specified to be compliant with OGC.
- As a consequence you should first check the potential outcome of your
geomunion operation before creating the geomcolumn, you might run
something like:
select distinct(geometrytype(geomunion(t1.the_geom, t2.the_geom)))
from gf_veg1 t1, gf_veg2 t2
where t1.the_geom && t2.the_geom;
Regards,
Frank
--
Frank Koormann | ++49-541-335 08 30 | http://www.intevation.de/
Intevation GmbH, Georgstr. 4, 49074 Osnabrück, DE | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
More information about the postgis-users
mailing list