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-boun...@lists.osgeo.org [mailto:postgis-users-boun...@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.mala...@shrewsburyma.gov<mailto:jon.mala...@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-boun...@lists.osgeo.org<mailto:postgis-users-boun...@lists.osgeo.org> [mailto:postgis-users-boun...@lists.osgeo.org<mailto:postgis-users-boun...@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.mala...@shrewsburyma.gov<mailto:jon.mala...@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@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users