Hi Regina,
if i integrate your statement like this:
drop table intersect_gf3;
create table intersect_gf3(gid integer) with oids;
select
addgeometrycolumn('','intersect_gf3','the_geom','31467','MULTIPOLYGON',2);
insert into intersect_gf3
select t1.gid,multi(intersection(t1.the_geom, t2.the_geom))
from gf_clc t1, gf_veg1 t2
where t1.the_geom && t2.the_geom;
i although get the error:
ERROR: new row for relation "intersect_gf3" violates check constraint
"enforce_geotype_the_geom"
SQL Status:23514
hasta luego Andreas
Obe, Regina schrieb:
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> [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
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users