Skip to main content
Question

Create line from two Oracle sdo_geometry points in the same row

  • May 5, 2015
  • 2 replies
  • 232 views

esko
Forum|alt.badge.img+2
Hi,

 

we have stored connection trail end points (two) in an Oracle table as SDO_GEOMETRY objects.

 

Is there a way if FME to create a line between these endpoints ?

 

 

Example table rows: 
 TRAIL_ID               1 FROM_GEOM      (2001; 3067; (493362,409; 6705891,014; ); (; )) TO_GEOM            (2001; 3067; (457011,701; 6702168,689; ); (; )) TRAIL_ID               2 FROM_GEOM      (2001; 3067; (394756,785; 6705399,878; ); (; )) TO_GEOM            (2001; 3067; (378619,895; 6735549,226; ); (;  )) etc.
 

 

This could also be generated with some complex PL/SQL coding but I haven't found any working examples and I besides, I'd like to to FME's ETL capabilities here too.

 

 

Kind regards,

 

Esko

 

 

 
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • May 5, 2015
Hi,

 

 

it might be possible to read both geometries using FME, but I've never tried it myself. One alternative solution could be to use an SQLCreator and cast your point geometries into x,y coordinate pairs and then use the VertexCreator to join the two coordinates into a line.

 

 

Something like this might work (untested):

 

 

select

 

from_geom.sdo_point.x as from_x,

 

from_geom.sdo_point.y as from_y,

 

to_geom.sdo_point.x as to_x,

 

to_geom.sdo_point.y as to_y

 

from mytable

 

 

Remember to expose the attributes from_x, from_y, to_x and to_y.

 

 

David

esko
Forum|alt.badge.img+2
  • Author
  • May 6, 2015
Follow-up :

 

 

I will create a separate table containing only trail id and linegeometry.  As suggested, I will use SQL Creator and two vertex creators.

 

 

Query in SQL Creator is somewhat different from suggested: 
 SELECT  a.trail_obj_sid, f.x as FROM_X, f.y as FROM_Y, t.x as TO_X, t.y as TO_Y FROM    TOPO_ALL_TRAILS_MAPPED a,         table(sdo_util.getvertices(A.FROM_GEOM)) f,         table(sdo_util.getvertices(A.TO_GEOM)) t where   a.from_geom is not null and a.to_geom is not null;
 And of course you need two Vertex creators, first one to two create starting point and second one to append  ending point to create a lines.  

 

 

0684Q00000ArJ3wQAF.png

 

Thanks to David for pointing me to the right direction.

 

 

Br, Esko