[postgis-users] Get only the main river. Smoothline???

Rémi Cura remi.cura at gmail.com
Mon Jun 8 08:45:42 PDT 2015


if you have start and end point of geom B,
you can get the river path with a shortest path method (one liner using
python, can be done in few hours using plpgsql).

The idea is that you cut your geom into segments(pairs of points)
, the length of the segment is the weight of this edge
, and you know which segment is connected to which segment (adjacency
graph).
Then you use Networkx
<http://networkx.lanl.gov/reference/generated/networkx.algorithms.shortest_paths.generic.shortest_path.html#networkx.algorithms.shortest_paths.generic.shortest_path>shortest
path distance.

Else,
you are up to use some nasty workaround I suppose (playing with buffers on
your original river surface, testing which segment intersects etc. ).
I tried that but it ends up being more work (and more corner cases) than
doing the things properly (in my experience).

Cheers,
Rémi-C

2015-06-08 16:42 GMT+02:00 toni hernández <toni at sigte.udg.edu>:

>  Hi everyone,
>
> I have a multilinestring with a river and all its afluents as you can see
> in this image
> http://sigserver4.udg.edu/apps/geometries.png
>
> I got geometry A using St_StraithSkeleton.
>
> Is there a way to go from geometry A to geometry B??
> Maybe something similar to SmoothLine???
>
>
>  --
>  *Toni Hernández Vallès*
> Servei de Sistemes d'Informació Geogràfica i Teledetecció
> -
> Universitat de Girona
> *SIGTE*
> -
> Pl. Ferrater Mora 1
> 17071 Girona
> Tel +34 972 418 039 (7026 intern)
> toni at sigte.udg.edu
>
> http://www.sigte.udg.edu
> Twitter http://twitter.com/SIGTE_UDG
>
>
> _______________________________________________
> 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/20150608/dd56d66d/attachment-0001.html>


More information about the postgis-users mailing list