[postgis-users] function difference(geometry, geometry) throws an exception

Martin Davis mbdavis at VividSolutions.com
Fri May 5 13:43:46 PDT 2006


This is a robustness issue.

You're running 

	Select difference(A, intersection(buffer(B, 6), A)

If you can run the equivalent but simpler:

	select difference(A, buffer(B, 6)) 

instead you will probably avoid the robustness problem.

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net] On 
> Behalf Of toni hernnadez
> Sent: April 24, 2006 2:03 AM
> To: PostGIS Users Discussion
> Subject: [postgis-users] function 
> difference(geometry,geometry) throws an exception
> 
> 
> HI,
> 
> If I execute the sql that follows I got the error:
> 
> NOTICE:  TopologyException: side location conflict 
> (498355,651613,651613)
> ERROR:  GEOS difference() threw an error!
> 
> Does anyone know what this means?
> 
> I use buffer, intersection and diference functions. All in 
> the same sql I have tested this in postgis version 1.1 and 
> 1.0. This is the sql hat throws the exception is this one:
> 
> select astext(difference(
> 
> (GeomFromText('POLYGON((498356.421005198 
> 651606.895014999,498352.452255198 651623.299181666,498370.708505198 
> 651634.940848333,498405.898088531 651651.080431666,498441.616838531 
> 651665.367931666,498469.662671864 651680.713764999,498473.631421864 
> 651670.130431666,498479.716838531 651644.465848333,498488.183505198 
> 651612.451264999,498468.339755198 651603.190848333,498387.112671864 
> 651566.149181666,498374.412671864 651562.709598333,498372.562028232 
> 651563.436636902,498372.785232024 651564.01338174,498372.987592376 
> 651565.172049121,498372.960019638 651566.347931579,498370.049602971 
> 651590.160431579,498369.952570713 651590.594769057,498369.986735951 
> 651590.441838025,498369.952368124 651590.728125827,498369.858822152 
> 651591.014407994,498369.793156749 651591.308340611,498369.676598025 
> 651591.572075168,498369.587038588 651591.846157196,498361.914121922 
> 651609.308657196,498361.337694991 651610.333933648,498360.572322429 
> 651611.227054386,498359.647417073 651611.953697279,498358.598522519 
> 651612.485937849,498357.465947195 651612.80332239,498356.293215336 
> 651612.893653991,498355.12539437 651612.753461259,498355.01255936 
> 651612.716591129,498356.421005198 651606.895014999))',23031))
> 
> ,
> 
> (select       
>     intersection(
>         (select buffer(geomfromtext('LINESTRING(498356.421005198 
> 651606.895014999,498352.452255198 651623.299181666)',23031),6))
>         ,
>         (GeomFromText('POLYGON((498356.421005198 
> 651606.895014999,498352.452255198 651623.299181666,498370.708505198 
> 651634.940848333,498405.898088531 651651.080431666,498441.616838531 
> 651665.367931666,498469.662671864 651680.713764999,498473.631421864 
> 651670.130431666,498479.716838531 651644.465848333,498488.183505198 
> 651612.451264999,498468.339755198 651603.190848333,498387.112671864 
> 651566.149181666,498374.412671864 651562.709598333,498372.562028232 
> 651563.436636902,498372.785232024 651564.01338174,498372.987592376 
> 651565.172049121,498372.960019638 651566.347931579,498370.049602971 
> 651590.160431579,498369.952570713 651590.594769057,498369.986735951 
> 651590.441838025,498369.952368124 651590.728125827,498369.858822152 
> 651591.014407994,498369.793156749 651591.308340611,498369.676598025 
> 651591.572075168,498369.587038588 651591.846157196,498361.914121922 
> 651609.308657196,498361.337694991 651610.333933648,498360.572322429 
> 651611.227054386,498359.647417073 651611.953697279,498358.598522519 
> 651612.485937849,498357.465947195 651612.80332239,498356.293215336 
> 651612.893653991,498355.12539437 651612.753461259,498355.01255936 
> 651612.716591129,498356.421005198 651606.895014999))',23031)
>         )
>     )
> )
> 
> )
> )
> 
> _______________________________________________
> 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