Join series of ordered single lines into one single line in Oracle Spatial

124 views Asked by At

Have a series of ordered geometries (lines) of type:

MDSYS.SDO_GEOMETRY(4402, 4326, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-87.5652173103127, 41.6985300456929, 0, 510.1408, -87.5652362658404, 41.6985530209061, 0, 510.14287, -87.5652682628194, 41.6985911197852, 0, 510.14632, ...)

Would like to join these into a "single" line of the same type, but with the vertices merged into a single line: i.e. another geometry (line) of type:

MDSYS.SDO_GEOMETRY(4402, 4326, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-87.5652173103127, 41.6985300456929, 0, 510.1408, -87.5652362658404, 41.6985530209061, 0, 510.14287, -87.5652682628194, 41.6985911197852, 0, 510.14632, ...)

Tried:

  • SDO_UTIL.APPEND to incrementally join pair of lines, but this resulted in a "multipart" polyline, not a "single" polyline, i.e.:

    MDSYS.SDO_GEOMETRY(4406, 4326, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1, 241, 2, 1, 377, 2, 1, 465, 2, 1, 733, 2, 1, 865, 2, 1, 1365, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-89.7856903197518,...)
    
  • same issue with SDO_AGGR_LRS_CONCAT

  • SDO_UTIL.CONCAT_LINES came closest to it, by producing a single line, but it seems some of the vertices SDO_ORDINATE_ARRAY were not correct...

Either there must be another function that does this easily, or perhaps was not using one of the above correctly... or perhaps may have to write a custom function to go into each line's SDO_ORDINATE_ARRAY and join those individually (?).

New to oracle spatial (spatial queries of any type) and documentation out there seem sparse. Any input would be appreciated.

0

There are 0 answers