Oracle PL/SQL Object Wrapper for SDO_LRS package

$25.00

This product contains the source code, test code, and documentation for a PL/SQL Object wrapper that exposes all Oracle’s SDO_LRS package Linear Referencing System functions and procedures.

Store
0 out of 5
Category:

Description

Here is an example SQL Select statement that shows the power of an object implementation of LRS functions.

with data as (

  select t_lrs(sdo_geometry(2002,28355,NULL,SDO_ELEM_INFO_ARRAY(1,2,2),SDO_ORDINATE_ARRAY(252230.478,5526918.373, 252400.08,5526918.373, 252230.478,5527000.0)),0.005) as geom,

               sdo_geometry(2001,28355,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(252410.0,5526920.3)) as point 

   from dual

)

select d.geom.ST_LRS_Add_Measure().geom as geom,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Valid_Measure(100) as vMeasure1,

       d.geom.ST_LRS_Valid_Measure(100) as vMeasure2,

       d.geom.ST_LRS_Valid_Measure(9999999) as vMeasure3,

       d.geom.ST_LRS_Add_Measure()

             .ST_Length() as endM3,

       d.geom.ST_Length(‘unit=FOOT’) as endM4,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Is_Shape_Pt_Measure(0) as isShpPtM1,

       d.geom.ST_LRS_Is_Shape_Pt_Measure(0) as isShpPtM2,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Translate_Measure(100).geom as tGeom1,

       d.geom.ST_LRS_Translate_Measure(100).geom as tGeom2,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Scale_Measure(10,d.geom.ST_Length()+11,100).geom as sGeom,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Reset_Measure().geom as geomR,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Start_Measure() as startM1,

       d.geom.ST_LRS_Start_Measure() as startM2,

       d.geom.ST_LRS_Start_Point() as spoint,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_End_Measure() as endM1,

       d.geom.ST_LRS_End_Measure() as endM2,

       d.geom.ST_LRS_End_Point() as epoint,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Measure_Range() as mRange1,

       d.geom.ST_LRS_Measure_Range() as mRange2,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Is_Measure_Increasing() as mIncreasing1,

       d.geom.ST_LRS_Is_Measure_Increasing() as mIncreasing2,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Is_Measure_Decreasing() as mDecreasing1,

       d.geom.ST_LRS_Is_Measure_Decreasing() as mIncreasing2,

       d.geom.ST_LRS_Percentage_To_Measure(50.0) as mFromPct,

       d.geom.ST_LRS_Measure_To_Percentage(20.0) as pFromM,

       d.geom.ST_LRS_Find_Measure(point) fm,

       d.geom.ST_LRS_Find_Offset(point) as oGeom, 

       d.geom.ST_LRS_Interpolate_Point(point) as ip,

       case when d.geom.ST_LRS_Find_Measure(point) = d.geom.ST_LRS_Interpolate_Point(point) 

            then ‘EQUAL’ 

            else ‘UNEQUAL’ 

        end as find_interp,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Reverse_Geometry().geom as rGeom,

       d.geom.ST_LRS_Reverse_Measure().geom as rMGeom,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Locate_Between(20,200).geom as bGeom1,

       d.geom.ST_LRS_Locate_Between(20,200).geom as bGeom2,

       d.geom.ST_LRS_Locate_Between(20,200).ST_Round(3,3,2,3).ST_Length() as lbLength,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Locate_Along(200,0) as lGeom1,

       d.geom.ST_LRS_Locate_Along(200,0) as lGeom2,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Locate_Along(200,10) as lOGeom,

       d.geom.ST_LRS_Add_Measure()

             .ST_LRS_Project_Point(point) as pPoint,  /* Same as ST_Snap */

       d.geom.ST_LRS_Snap(point) as sPoint,

       d.geom.ST_LRS_Add_Measure(1.0,d.geom.ST_LRS_End_Measure()+1.999)

             .ST_LRS_Reverse_Measure()

             .ST_LRS_Locate_Between(20,200)

             .ST_LRS_Translate_Measure(0.999)

             .ST_LRS_Drop_Measure().geom as rGeom

  from data d;

Reviews

There are no reviews yet.

Be the first to review “Oracle PL/SQL Object Wrapper for SDO_LRS package”