[postgis-users] flow analysis

Jonatan Malaver jon.malaver at shrewsburyma.gov
Thu May 16 04:45:50 PDT 2013


Here's my query
WITH RECURSIVE flow(gid, geom) AS (
    SELECT gid, geom FROM l4_3 WHERE gid = 212
  UNION ALL
    SELECT n.gid, n.geom
    FROM l4_3 n, flow f
    WHERE ST_DWithin(ST_EndPoint(f.geom),ST_StartPoint(n.geom),0.01)
  )
SELECT gid, ST_AsText(geom)
FROM flow;

Here's the result
212;"MULTILINESTRING((589700.21 2926252.04,589698.873744219 2926256.62316697))"

l4_3 is a multilinestring of and electrical circuit. I would like to see what's downstream the grid from a transformer, fuse, or upstream from a house meter.

Thanks,

Jonatan

From: postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org> [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Nicolas Ribot
Sent: Wednesday, May 15, 2013 12:55 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] flow analysis

Hello,

This precise example, no, but the "WITH RECURSIVE" construct yes.

Could you post your query and the data model ?

Nicolas

On 15 May 2013 17:56, Jonatan Malaver <jon.malaver at shrewsburyma.gov<mailto:jon.malaver at shrewsburyma.gov>> wrote:
Hello again,
I tried the example, but it only returns the same line. Has anyone tried that example?

Thanks,

Jonatan

From: postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org> [mailto:postgis-users-bounces at lists.osgeo.org<mailto:postgis-users-bounces at lists.osgeo.org>] On Behalf Of Nicolas Ribot
Sent: Tuesday, May 14, 2013 1:02 PM
To: PostGIS Users Discussion

Subject: Re: [postgis-users] flow analysis

Hi,

The WITH RECURSIVE construct allows to walk a graph:

This link may help:
http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html

Nicolas

On 14 May 2013 18:40, Jonatan Malaver <jon.malaver at shrewsburyma.gov<mailto:jon.malaver at shrewsburyma.gov>> wrote:
Hello, is it possible to do any flow analysis? For example, query postgis for what down flow a certain point?

Thanks,

Jonatan Malaver


_______________________________________________
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<mailto: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/20130516/7f0ed17b/attachment.html>


More information about the postgis-users mailing list