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

Adrien ANDRÉ adrien.andre at onf.fr
Wed Aug 20 07:03:49 PDT 2014


Hi,

sorry for the late response.

Thank you for the tips! Having limited time, i ended up using GRASS v.clean.

I have to train on smaller datasets to feel at ease with PostGIS topologies.


For those who'd need theoretical basics, read

Worboys, M.F. and Duckham, M. (2004) GIS: A Computing Perspective,
Second Edition, CRC Press, ISBN: 0415283752 (http://worboys.duckham.org/)
Chapter 5, part 3

which features a clear, progressive and complete explanation about topology.


Regards,

Adrien


Le 08/07/2014 05:34, Rémi Cura a écrit :
> Hey,
> just a trick I uses to make sure everything will work :
> 
> _first check befor that every geom is valid, as a length/area, etc etc
> _second if you can node your geom before going ot topology
> 
> _when converting to topogeom, uses an order by on your data.
> _you can modify to topogeom function to add an exception catcher and
> another output (a boolean saying if the conversion worked)
> _This way you launch conversion on everything and keep the result, then
> you relaunch on errors, and hopefully it will work because the topology
> is already containing something.
> 
> Yes this is less than clean, but it works for me ...
> 
> Now if you have very serious problem: go grass 7, then with 2 command
> line you simultaneously import your data into grass and push it to
> postgis topology. IF this doesn't work you need a third command line to
> clean your topology with grass.
> I did it it is easy
> 
> 
> 
> Cheers,
> Rémi-C
> 
> 
> 2014-07-08 7:53 GMT+02:00 Sandro Santilli <strk at keybit.net
> <mailto:strk at keybit.net>>:
> 
>     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;
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
>     http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> 
-------------- 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/20140820/98c98d3c/attachment.vcf>


More information about the postgis-users mailing list