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

Sandro Santilli strk at keybit.net
Mon Jul 7 22:53:51 PDT 2014


On Mon, Jul 07, 2014 at 05:21:16PM -0300, Adrien ANDRÉ wrote:
> Thank you, updating PostGIS to 2.2.0dev solved the "shell must be
> closed" errors.
> 
> Now "faces mismatch" are dominant :
> 
>  123 faces mismatch: invalid topology ?
>   22 SQL/MM Spatial exception - geometry crosses edge
>    2 Edge changed disposition around end node
>    1 SQL/MM Spatial exception - geometry crosses a node
>    1 Spatial exception - geometry intersects edge
>    1 Edge changed disposition around start node
> 
> 
> How do i understand them ?

You read the code:
https://github.com/postgis/postgis/blob/2.1.3/topology/sql/sqlmm.sql.in#L3553-L3563

It seems to be a sign of invalid topology being constructed by previous
steps, so what you could do is have your population routing stop at
the very first occurrence of any of those errors and check the validity
of the topology constructed so far, using ValidateTopology.

Make sure to be running the latest GEOS release, which should also help with
some of those issues. Then, as usual, try to find the smallest set of
operations that can take you from an empty topology to an invalid topology
by only using the toTopoGeom function.

NOTE: order of toTopoGeom calls can change the results.
NOTE2: tolerance specified can change the results.

--strk;


More information about the postgis-users mailing list