0

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.

U13-Forward
  • 69,221
  • 14
  • 89
  • 114
gurunara5
  • 1
  • 1
  • What is the difference between the first piece of code defining the line and the second one you wish as a result? Please provide enough sample data to demonstrate the issue and the result you want for this sample data – astentx Dec 18 '22 at 22:16
  • The input would be an array of lines, each something like; 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, ...) The output would be a single geometry of the same type (geometry type = 4402, but where the SDO_ORDINATE_ARRAY is the join of all the SDO_ORDINATE_ARRAY values in the input array). What resulted from SDO_AGGR_LRS_CONCAT was a multipart polyline (where geometry type = 4406). – gurunara5 Dec 19 '22 at 01:43
  • Perhaps it would be possible to just change the resulting multi-part polyline and change the geometry type = 4402, and SDO_ELEM_INFO_ARRAY = (1, 2, 1), if there isn't an oracle function that achieves the same..? – gurunara5 Dec 19 '22 at 01:44
  • SDO_LRS.CONCATENATE_GEOM_SEGMENTS seems to give correct result, but it clips the third element in the SDO_ORDINATE_ARRAY. For e.g. the resulting geometry is: MDSYS.SDO_GEOMETRY(4402, 4326, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 2, 1), MDSYS.SDO_ORDINATE_ARRAY(-87.5471018117985, 41.6482888766313, 0, 506.44231, ...) where the third element is => 0. – gurunara5 Dec 19 '22 at 15:47

0 Answers0