[postgis-users] topology overlapping of edges

Sandro Santilli strk at keybit.net
Thu Sep 27 01:06:21 PDT 2012

On Thu, Sep 27, 2012 at 09:11:28AM +0200, Mario Jurcevic wrote:
> Hi,
> the cadastre data ( Suisse ) are full of this overlaps, It happens
> when they introduce arc curves ( specially with streets ),
> i suppose due to inaccuracy of the computation of  the arc points or
> for historically reason ( digitizing errors ) or simply
> because is cheaper to measure.
> Attached the image of the overlap.

A small tolerance passed to the CreateTopology should help for those
cases. But is known to break if any geometry has any two vertices
which are closer than the given tolerance. You may pre-process the
input geometries with ST_SnapToGrid for possibly safer results.

> In addition I have some more questions:
> Will topology support edge with arcs and not only linestrings?

You mean curves ? No, not currently. There's no topological operation
working for curves so it would not work to do that: can't tell if two
edges cross each other until ST_Cross(curve,curve) is implemented.

> I try to insert into an empty topology geometries with functions
> TopoGeo_AddLineString, addEdge, addIsoEdge and is incredibly slow,
> it was only a small subset of data ( 20'000 lines ) and  after
> waiting 10 minutes I dropped out, why is so slow  or maybe there is
> another way to insert data?

It is slow because it checks for intersections and performs noding for
everything you add. I'm sure it could be made faster given enough time
to carefully profile each use case. 
I've found that raising the memory assigned to the PostgreSQL process
also noticeably improves performances.

You can always skip all tests and insert the edges straight away, if
you know exactly what's expected as the structure. It will be faster.
You can then check with ST_ValidateTopology what's missing
(theoretically). That's what the TIGER loader does, for example, but
the input is already topological, no need to check.

Finally, you may want to try a development branch of GRASS, I've heard
there's PostGIS Topology backend support in there (or at least planned).
Maybe someone else on this list will know more about that.


 http://www.cartodb.com - Map, analyze and build applications with your data

                                       ~~ http://strk.keybit.net 

More information about the postgis-users mailing list