[postgis-users] Using PostGIS topology to clean-up network prior to routing
adrien.andre at onf.fr
Wed Aug 20 07:03:49 PDT 2014
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.
Le 08/07/2014 05:34, Rémi Cura a écrit :
> 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
> 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:
> 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
> by only using the toTopoGeom function.
> NOTE: order of toTopoGeom calls can change the results.
> NOTE2: tolerance specified can change the results.
> postgis-users mailing list
> postgis-users at lists.osgeo.org <mailto:postgis-users at lists.osgeo.org>
> postgis-users mailing list
> postgis-users at lists.osgeo.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 432 bytes
Desc: not available
More information about the postgis-users