[postgis-users] TopologyException: side location conflict

Paul Ramsey pramsey at refractions.net
Wed Oct 18 09:47:21 PDT 2006


You may find that using snaptogrid() with a small tolerance value on  
your input geometries fixes this problem up. Your reprojection is  
very slightly changing the relationship between input vertices in the  
two geometries, because of hardware precision and the tiny roundings  
associated with it.

P


On 18-Oct-06, at 3:30 AM, Gopal wrote:

> Hi All,
>
> I am running following version of postgis
> "POSTGIS="1.1.3" GEOS="2.2.2-CAPI-1.1.0" PROJ="Rel. 4.4.9, 29 Oct  
> 2004"
> USE_STATS"
> On "PostgreSQL 8.1.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> 3.4.2 (mingw-special)" on windows 2003 server.
>
> I am getting the following error when I try intersection on one row...
>
> NOTICE:  TopologyException: side location conflict
> (-0.5693,52.0949,52.0949)
> CONTEXT:  PL/pgSQL function "usp_getmetadata" line 39 at for over  
> select
> rows
>
> ERROR:  GEOS Intersection() threw an error!
> CONTEXT:  PL/pgSQL function "usp_getmetadata" line 39 at for over  
> select
> rows
>
>
> I've isolated, the row that gives the error, the geometry seems to be
> valid (I used the isvalid() function).
>
> Strange thing is the error only occurs, when using SRID 4326, when  
> using
> srid 27700 everything is fine
>
> Query in srid 27700 - Runs fine
>
> select intersection(GeometryFromText('POLYGON((496999.999878214
> 245000.006245037,497999.999876959 245000.006245039,497999.999876987
> 244000.006245681,496999.999878241 244000.006245684,496999.999878214
> 245000.006245037))',27700),expand(GeometryFromText('POINT(' ||
> 496000::text || ' ' || 243000::text || ')',27700),greatest 
> (2000,2000)))
>
> Same query but in srid 4326 - Raises the aforementioned error
>
> select intersection(GeometryFromText('POLYGON((-0.583894391985042
> 52.0950986609407,-0.569300265955149  
> 52.0949224289699,-0.569587785754047
> 52.0859336829619,-0.584178981284086  
> 52.0861098582684,-0.583894391985042
> 52.0950986609407))',4326),transform(expand(GeometryFromText('POINT 
> (' ||
> 496000::text || ' ' || 243000::text ||
> ')',27700),greatest(2000,2000)),4326))
>
> I am not quite sure what the error means, or how to handle it in a  
> query
> and carry on processing upon encountering it
>
> Any help would be appreciated.
>
> Thanks
> Gopal
> _______________________________________________
> 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