Oracle Spatial har en lineær reference pakke kaldet SDO_LRS . Den kan bruges til at finde midtpunktskoordinaterne for en polylinje.
--In this case, 'sdo' is the name of the sdo_geometry column.
sdo_lrs.convert_to_std_geom(sdo_lrs.locate_pt(sdo_lrs.convert_to_lrs_geom(sdo,3)
,sdo_geom.sdo_length(sdo,3)/2)).sdo_point.x as midpoint_x,
sdo_lrs.convert_to_std_geom(sdo_lrs.locate_pt(sdo_lrs.convert_to_lrs_geom(sdo,3)
,sdo_geom.sdo_length(sdo,3)/2)).sdo_point.y as midpoint_y
For bonuspoint:
Sådan er ESRI's SDE.ST_GEOMETRY kan konverteres til SDO_GEOMETRY med det formål at få midtpunktskoordinaterne:
select
sdo_lrs.convert_to_std_geom(sdo_lrs.locate_pt(sdo_lrs.convert_to_lrs_geom(sdo,3),sdo_geom.sdo_length(sdo,3)/2)).sdo_point.x as midpoint_x,
sdo_lrs.convert_to_std_geom(sdo_lrs.locate_pt(sdo_lrs.convert_to_lrs_geom(sdo,3),sdo_geom.sdo_length(sdo,3)/2)).sdo_point.y as midpoint_y
from
(select
sdo_util.from_wktgeometry(sde.st_astext(shape)) as sdo
from
roads)
Dette svar er inspireret af et svar på Code Review:Beregn midtpunktet af en polylinje .