[postgis-users] Problems with GeomUnion

strk at refractions.net strk at refractions.net
Mon Apr 11 04:13:09 PDT 2005


On Fri, Apr 08, 2005 at 05:57:31PM -0400, Bill Binko wrote:
> On Fri, 8 Apr 2005 strk at refractions.net wrote:
> 
> > On Fri, Apr 08, 2005 at 11:08:59AM -0400, Bill Binko wrote:
> > > On Thu, 7 Apr 2005, Martin Davis wrote:
> > > 
> > > > > Now I need a way to fix self-intersecting shapes.  
> > > > 
> > > > If you do a buffer(0) on the shapes as you load them (or after you load
> > > > them), that will convert them to valid geometry while preserving their
> > > > outline.
> > > > 
> > > 
> > > I'm having some issues with that solution (and I was very excited to hear 
> > > such a simple one!).  When I run this:
> > > 
> > > update parcels set parcel_shape = buffer(parcel_shape, 0);
> > > 
> > > I get:
> > > 
> > > ERROR:  new row for relation "parcels" violates check constraint "enforce_geotype_parcelShape"

Sorry Bill, I misread your message, the constraint being violated
is enforce_geotype, meaning output geometry TYPE is different from
input geometry TYPE. This usually happens for lines or points becoming
polygons but can also happen in other situations. You should try
putting the output somewhere else, unless you drop your constraints.
Check out "CREATE TABLE <name> AS SELECT ..." syntax in postgresql
manual.

--strk;

> > 
> > What version of postgis/geos are you running ?
> > Could you provide an .sql file containing the 2d geometry that
> > fed to buffer(0) becomes a non-2d one ? 
> > --strk;
> 
> select postgis_full_version() reads:
> 
>  POSTGIS="1.0.0RC6" GEOS="2.1.1" PROJ="Rel. 4.4.7, 31 March 2003"
> USE_STATS DBPROC="0.3.0" RELPROC="0.3.0"
> 
> I've put a dump of all of the offensive shapes at 
> http://www.binko.net/dump.gz However, I cannot tell which are causing the 
> failures, since the buffer() calls never complete and the transaction 
> rolls back.
> 
> I'm open to suggestions on narrowing those down.
> 
> Bill
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list