[postgis-users] Using PostGIS topology to clean-up network prior to routing

Adrien ANDRÉ adrien.andre at onf.fr
Thu Jul 3 05:24:05 PDT 2014

Hello everyone,

I have two LineString layers (roads and paths) that i merged in one
table using UNION. It's the "network" which i want to use PGRouting on.

To create nodes at intersections, i am using
topologies as described in Leplatre M.'s blog post [1].

It almost works, nodes at intersections are created.

But for some linestrings, the toTopoGeom function [2] outputs errors.
Here is a list with counts:

 458 lwpoly_from_lwlines: shell must be closed
  41 faces mismatch: invalid topology ?
  30 SQL/MM Spatial exception - geometry crosses edge
   8 query string argument of EXECUTE is null

So the "shell must be closed" is the main one.

All linestrings are valid (ST_IsValid says).

Would you know why this happens?
How may i debug this?

It's critical for my application as problematic linestrings are excuded
from the final network, making PGRouting not finding some paths.

Many thanks in advance,



[2] http://postgis.refractions.net/docs/toTopoGeom.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: adrien_andre.vcf
Type: text/x-vcard
Size: 432 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140703/b53f6d88/attachment.vcf>

More information about the postgis-users mailing list