[postgis-users] join of topogeo_AddLineString() output

Wim Nederend wim.nederend at and.com
Tue Sep 18 06:50:06 PDT 2012


Hi,

I want to do something with the edges returned by topogeo_AddLineString()

(I'm not a very experienced Postgres user).

I would expect the following to be working

    for input_rec in
       select foo.x from
         (select topogeo_AddLineString('wimpy', geomvar) as x) as foo
             inner join edge_data as e
                 on e.edge_id = foo.x
     loop
         raise notice 'faces: % %', input_rec.left_face,
                                     input_rec.right_face;
     end loop;

But I get no output.

Following code does work, but looks a bit clumsy to me:

     select array_agg(x) into edges from
         ( select topogeo_AddLineString('wimpy', geomvar) as x) as foo;
     --raise notice 'edges %', edges;

     for input_rec in
             select e.left_face, e.right_face, e.edge_id
                 from edge_data as e
                    where edge_id = any(edges)
     loop
         raise notice 'faces: % %', input_rec.left_face,
                                     input_rec.right_face;

     end loop;

Does anyone have a suggestion for me?

Regards, Wim



More information about the postgis-users mailing list