Hi Jonatan, I am glad I could help. Have success with the tweaking!
Regards, Birgit
Am 26.09.2016 um 14:24 schrieb Jonatan Malaver:
Hi Birgit, thank you so much!! your code put me on the right track.
I'm still tweaking it a bit since your code assumes only 1 line is
attached to the endpoint. Ho
Hi Birgit, thank you so much!! your code put me on the right track. I'm
still tweaking it a bit since your code assumes only 1 line is attached to
the endpoint. However, the endpoint of one line could break into 2 new
starpoints.
thanks,
jon
On Tue, Sep 20, 2016 at 5:38 AM Birgit Laggner
wrote:
Hi Jonatan,
based on the anonymous code block Leknín came up with, I tried to adapt
it to your problem:
DO $$
DECLARE c_line record; c_gid integer; c_geom geometry; line record; gid
integer; geom geometry; i integer; n integer;
BEGIN
EXECUTE 'SELECT count(*) FROM electric_line' INTO n;
--i
Hello again, I do not have parent line id. All I have is a starting point
from where the direction should reference.
On Wed, Sep 14, 2016 at 9:09 AM Leknín Řepánek
wrote:
> On Wed, Sep 14, 2016 at 12:09:23PM +, Jonatan Malaver wrote:
> > the reason being is that I do a network analysis by ru
On Wed, Sep 14, 2016 at 12:09:23PM +, Jonatan Malaver wrote:
> the reason being is that I do a network analysis by running the following
> function:
> WITH RECURSIVE flow(gid, geom) AS (
> SELECT e.gid, e.geom FROM electric_line e, transformers t WHERE
> ST_Distance
> (t.geom,ST_StartPoint
the reason being is that I do a network analysis by running the following
function:
WITH RECURSIVE flow(gid, geom) AS (
SELECT e.gid, e.geom FROM electric_line e, transformers t WHERE
ST_Distance(t.geom,ST_StartPoint(e.geom)) <= 0.01 AND t.gid=$1
UNION ALL
SELECT n.gid, n.geom
FROM el
Depends on what you mean by direction. If you want to grab the start and end
points (st_startpoint and st_endpoint) and check their x and y (st_x and st_y)
for some condition (both less at the end?) Then update the record with the
value of st_reverse.
I guess my other question is why it matters
This is the query I have so far:
WITH RECURSIVE flow(gid, geom) AS (
SELECT e.gid, e.geom FROM electric_line e WHERE e.gid = 3312
UNION ALL
SELECT n.gid, n.geom
FROM electric_line n, flow f
WHERE ST_DWithin(ST_EndPoint(f.geom),ST_StartPoint(n.geom),0.01)
)
UPDATE electric_line S
ST_EndPoint, ST_StartPoint, ST_Reverse.
On Tue, Sep 13, 2016 at 12:31:07PM +, Jonatan Malaver wrote:
> Hello,
>
> I'm trying to come up with a query that would check the direction of a
> line.
> If the end point is not the start point of the next line to update the line by
> reversing tha
Hello,
I'm trying to come up with a query that would check the direction of a
line. If the end point is not the start point of the next line to update
the line by reversing that line. Can anyone give me pointers on how to do
it?
Thanks,
Jon
___
postg
10 matches
Mail list logo