[postgis-users] Checking Road Network Topology

toni hernández toni at sigte.udg.edu
Thu Jan 22 07:13:44 PST 2015


Steve,

I had the same issue when working with geometries using srid=4326 . I 
was also following the same link 
(http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html)
Then I tried with some projected geometries (units = meters) and the 
problem was gone. I am not sure why. Maybe it was just a coincidence.

cheers.


On 20/01/2015 20:45, Miller, Stephan wrote:
>
> All –
>
> I am attempting to validate the topology of a dense road network ( 1.2 
> Million roads) modeled after 
> http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html 
> from July 2013 
> <http://blog.mathieu-leplatre.info/use-postgis-topologies-to-clean-up-road-networks.html%20from%20July%202013>.  
> The code is given below:
>
> -- HC_RoadTopologicalCheck
>
> -- Drop the existing topology
>
> SELECT topology.DropTopology('roads_topo');
>
> SELECT topology.CreateTopology('roads_topo',4326, 0.000001, true);
>
> SELECT topology.AddTopoGeometryColumn('roads_topo', 'fgcm', 
> 'transportationgroundcrv', 'topo_shape', 'LINESTRING');
>
> --UPDATE transportationgroundcrv SET topo_shape = 
> topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0);
>
> -- Encapsulate the UPDATE inside code that checks for errors
>
> DO $$ DECLARE r record;
>
> BEGIN
>
>     FOR r IN SELECT * FROM transportationgroundcrv loop
>
>         BEGIN
>
>             UPDATE transportationgroundcrv SET topo_shape = 
> topology.toTopoGeom(transportationgroundcrv.shape, 'roads_topo', 1, 1.0)
>
>             WHERE r.objectid = r.objectid;
>
>         EXCEPTION
>
>                 WHEN OTHERS THEN
>
>                 RAISE WARNING 'Loading of record % failed: %', 
> r.objectid, SQLERRM;
>
>         END;
>
>     END LOOP;
>
> END$$;
>
> Select * from ValidateTopology('roads_topo');
>
> I am getting everything passing to the exception statement and all the 
> records are being flagged with
>
> WARNING:  Loading of record 791456 failed: SQL/MM Spatial exception - 
> curve not simple
>
> Intermittently, I am getting the following error also.
>
> WARNING:  Loading of record 792591 failed: Spatial exception - 
> geometry intersects edge 69612
>
> Everything appears to be flagged as an error; the ValidateTopology 
> call returns nothing.
>
> Any insights or suggestions would be appreciated.
>
> Steve
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150122/46c8fd0b/attachment.html>


More information about the postgis-users mailing list