[postgis-users] Finding a TopologyException

Stephen Woodbridge woodbri at swoodbridge.com
Mon Feb 15 06:59:43 PST 2010


strk wrote:
> On Mon, Feb 15, 2010 at 03:51:40PM +0800, Ben Madin wrote:
> 
>> NOTICE:  TopologyException: found non-noded intersection between LINESTRING (-0.204257 0.999226, -0.204257 0.99858) and LINESTRING (-0.204257 0.995743, -0.204257 0.999226) at -0.204257 0.999226
> 
>> How does the coordinates returned by the error relate to my geometry? or What do they mean? Can I use this information to find the problem part of the geometry.
> 
> Often such problems are due to invalid geometries in input.
> What you could do is:
> 	SELECT gid, ST_isValidReason(the_geom) where NOT ST_isValid(the_geom);
> 
> That should give you more usable informations.
> Even better, the trunk version of postgis has an ST_isValidDetail which also
> gives you the problematic point as a Geometry.

You might also check to see if you have same geometries located near the 
exception with:

select * from "table" where 
ST_expand(setsrid(makepoint(-0.204257,0.999226),4326), 0.001) && the_geom;

-Steve W



More information about the postgis-users mailing list