Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get X & Y coordinates from GEOM_SEGMENT_START_PT()

User_1871Jun 9 2022 — edited Jun 18 2022

How can I get the X & Y coordinates (numbers) from GEOM_SEGMENT_START_PT()'s resulting LRS point?
The coordinates are stored in SDO_ORDINATE_ARRAY( ), not SDO_POINT.

select
  sdo_lrs.geom_segment_start_pt(sdo_geometry('linestring(1 2, 3 4, 5 6)'))
from
  dual

SDO_LRS.GEOM_SEGMENT_START_PT(SDO_GEOMETRY('LINESTRING(12,34,56)')) 
---------------------------------------------------
SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(1,2))
--                                                                               🡅    

Desired output:

 X  Y
-- --
 1  2

Normally, I'd use something like a.shape.sdo_point.x. But I don't think that applies here, since the XYs aren't stored in the SDO_POINT.

Related: Stack Overflow - Get XY coordinates from GEOM_SEGMENT_START_PT() output

This post has been answered by David Lapp-Oracle on Jun 9 2022
Jump to Answer
Comments
Post Details
Added on Jun 9 2022
2 comments
1,062 views