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!

Why does GET_COORDINATE(GEOM_SEGMENT_START_PT(shape),2) return the first vertex?

User_1871Jun 30 2022 — edited Apr 3 2023

Regarding the below test:

with data as (select sdo_lrs.geom_segment_start_pt(
                   sdo_geometry('linestring(10 10, 20 20, 30 30)')
              ) as shape from dual)

select 
    sdo_util.get_coordinate(shape, 1).sdo_point.x as vertex_1_x,
    sdo_util.get_coordinate(shape, 2).sdo_point.x as vertex_2_x
from 
    data;

VERTEX_1_X VERTEX_2_X
---------- ----------
        10         10

Why does GET_COORDINATE(GEOM_SEGMENT_START_PT(shape),2) return the first vertex?
If anything, I would have thought it would return null or an error, since the second vertex doesn't exist in that startpoint geometry.
And to be honest, I don't understand why ...(shape, **1**).sdo_point.x would work in the first place, since the geometry doesn't have an sdo_point, it only has an sdo_ordinate_array:

MDSYS.SDO_GEOMETRY(2001, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1), MDSYS.SDO_ORDINATE_ARRAY(10, 10))
This post has been answered by jsharma-Oracle on Apr 3 2023
Jump to Answer
Comments
Post Details
Added on Jun 30 2022
2 comments
232 views