[postgis-users] Trace network from each source node and check that the trace reaches the sea

64 views
Skip to first unread message

Shaozhong SHI

unread,
Dec 30, 2021, 4:14:11 PM12/30/21
to PostGIS Users Discussion
In hydrological network, how to trace network from each source node and check whether the trace can reach the sea?

Any examples?

Regards,

David

Stephen V. Mather

unread,
Dec 30, 2021, 6:36:09 PM12/30/21
to postgi...@lists.osgeo.org

Hi David,

This is a good example. I have modified this to walk networks before, and it's a minimal and understandable example:

http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html

There may be some better ways to do this, as the postgres tooling has changed quite a bit. The use of a function may be precluded by some modern fancy join type. Others can speak better to that than I can these days.

Also, if you don't mind installing one more thing, pgrouting will do network traversal much more efficiently than a WITH RECURSIVE network traversal:

https://pgrouting.org/


Cheers,

Best,

Steve


On 12/30/21 4:13 PM, Shaozhong SHI wrote:

WARNING: This email originated outside of Cleveland Metroparks. DO NOT CLICK links or attachments unless you recognize the sender and know the content is safe.

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Shaozhong SHI

unread,
Dec 30, 2021, 6:56:15 PM12/30/21
to PostGIS Users Discussion
Hi, Steve,

I had a quick look at it and looks very interesting.

Can one walk ad traverse from source nodes identified in a collection of links and nodes in a river system and check out whether Strahler stream orders are correctly set?

Regards,

David

Shaozhong SHI

unread,
Dec 30, 2021, 7:03:44 PM12/30/21
to PostGIS Users Discussion
Hi, Steve,

I cannot see the pictures.

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
Jan 9, 2022, 10:26:03 AM1/9/22
to PostGIS Users Discussion
Hi, Steve,

Your demonstration script does work.

How to deal with the following scenario?

Suppose that we are handling 3D line strings.  We want to trace walking down the network.  If there be any line string not properly formed (namely, it does not present a consistent walking down).

How best put a check so that walking down is stopped?  And, we can report the missed formed line segment?

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
Mar 2, 2022, 8:00:44 AM3/2/22
to PostGIS Users Discussion, s...@clevelandmetroparks.com
Hi, Steve,

The network-walking-in_PostGIS sometimes produces additional straight lines.

Why does that happen?  How to make sure that resultant lines are correct?

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
Mar 10, 2022, 6:51:39 PM3/10/22
to PostGIS Users Discussion
Hi, Stephen,

Can your approach be used for checking continuity for names, while walking along?

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
May 7, 2022, 8:41:40 AM5/7/22
to PostGIS Users Discussion
A strange thing is that this recursive query got stopped by the following error.

ERROR:  invalid memory alloc request size 1073741824

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
May 7, 2022, 9:08:40 AM5/7/22
to PostGIS Users Discussion
Hi, Steve,

Is there any thing for doing the following:

Start from the source link
Find next link where source link's endnode = startnode of next link
replace the source link with the next link
until no further such connected link exists

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:

Shaozhong SHI

unread,
Jul 25, 2022, 8:59:05 AM7/25/22
to PostGIS Users Discussion
Hi, Steve,

The image does not load.  Where can I find it?  Colleagues of mine want to have a look.

Regards,

David

On Thu, 30 Dec 2021 at 23:36, Stephen V. Mather <s...@clevelandmetroparks.com> wrote:
Reply all
Reply to author
Forward
0 new messages