TABLE OF CONTENTS

1. OBJECT TYPE/T_LRS [ Types ]

[ Top ] [ Types ]

NAME

    T_LRS Object Type

DESCRIPTION

    An object type that provides LRS capabilities

WARNINGS

    This type should only be used for programming and should not be stored in the database.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jul 2021 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.1. T_LRS/ATTRIBUTES(T_LRS) [ Variables ]

[ Top ] [ T_LRS ] [ Variables ]

ATTRIBUTES

    geom       -- mdsys.sdo_geometry Object
    tolerance  -- Standard SDO_TOLERANCE value.
                  Since we need the geometry's tolerance for some operations eg sdo_area etc
                  let's add it to the type rather than have to supply it all the time to member functions

SOURCE

  geom       mdsys.sdo_geometry,
  tolerance  number,

1.2. T_LRS/CONSTRUCTORS(STANDARD) [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    A collection of "standard" T_LRS Constructors.

SOURCE

  Constructor Function T_LRS(SELF     IN OUT NOCOPY T_LRS)
                Return Self As Result,

  Constructor Function T_LRS(SELF     IN OUT NOCOPY T_LRS,
                             p_geom   IN mdsys.sdo_geometry)
                Return Self As Result,

1.3. T_LRS/PRINTING FUNCTIONS [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    A collection of printing functions.

SOURCE

  Member Function ST_Elem_Info_Equal(p_elem_info in mdsys.sdo_elem_info_array)
           Return integer deterministic,

  Member Function ST_Ordinates_Equal(p_ordinates in mdsys.sdo_ordinate_array)
           Return Integer deterministic,

  Member Function ST_Sdo_Point_Equal(p_sdo_point in mdsys.sdo_point_type)
           Return Integer deterministic,
        
  Member Function ST_Equals(p_geom in mdsys.sdo_Geometry)
           Return varchar2 deterministic

1.4. T_LRS/ST_Dims [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_Dims -- Returns number of ordinate dimensions

SYNOPSIS

    Member Function ST_Dims
             Return Integer Deterministic,

DESCRIPTION

    Is a wrapper over the mdsys.sdo_geometry get_dims() method ie SELF.GEOM.Get_Dims()

RESULT

    dimension (Integer) -- 2 if data 2D; 3 if 3D; 4 if 4D

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.5. T_LRS/ST_GeometryType [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_GeometryType -- Returns underlying mdsys.sdo_geometry's SQLMM Geometry Type.

SYNOPSIS

    Static Function ST_GeometryType
             Return VarChar2 Deterministic,

DESCRIPTION

    Is a wrapper over the MDSYS.ST_GEOMETRY ST_GeometryType() method. Returns textual description of the geometry type
    eg ST_Polygon for x003 mdsys.sdo_geometry object.

NOTES

    Is an implementation of OGC ST_GeometryType method.

PARAMETERS

    p_geom (sdo_geometry) -- Valid, non-null, sdo_geometry object

RESULT

    geometry type (varchar2) -- ST_Point; ST_Linestring; ST_Polygon; ST_Collection; ST_MultiPoint; ST_MultiLinestring; ST_MultiPolygon etc

EXAMPLE

    With Geometries As (
       select T_LRS.ST_GeometryType(sdo_geometry(2001,NULL,sdo_point_type(10,11,null),null,null),0.005,2,1) as TGEOM
         From Dual Union All
       Select T_LRS.ST_GeometryType(sdo_geometry(2002,NULL,NULL,sdo_elem_info_array(1,2,1),sdo_ordinate_array(10,45, 20,45, 23,48, 20,51, 10,51)),0.005,1,1) as TGEOM
         From Dual Union All
       Select T_LRS.ST_GeometryType(sdo_geometry(2003,NULL,NULL,sdo_elem_info_array(1,1003,3),sdo_ordinate_array(0,0, 10,10)),0.005,1,1) as TGEOM
         From Dual Union All
       select T_LRS.ST_GeometryType(sdo_geometry(2003,null,null,sdo_elem_info_array(1,1005,2, 1,2,1, 7,2,2), SDO_ORDINATE_ARRAY (10,128, 10,125, 20,125, 20,128, 15,130, 10,128)),0.005,2,1) as TGEOM
        From Dual Union All
       Select T_LRS.ST_GeometryType(sdo_geometry(2002,null,null,sdo_elem_info_array(1,4,3, 1,2,1, 3,2,2, 7,2,1),
                         sdo_ordinate_array(10,45, 20,45, 23,48, 20,51, 10,51)),0.005,2,1) as TGEOM
        From Dual
    )
    select a.TGeom.ST_GTYPE() as gtype,
           a.TGeom.ST_GeometryType() as Geometrytype
      From Geometries a;

    GTYPE GEOMETRYTYPE
    ----- ----------------
        1 ST_POINT
        2 ST_LINESTRING
        3 ST_POLYGON
        3 ST_CURVEPOLYGON
        2 ST_COMPOUNDCURVE

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.6. T_LRS/ST_Length [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_Length -- Returns length of underlying linestring.

SYNOPSIS

    Member Function ST_Round(p_unit in varchar2 default null)
             Return Number Deterministic,

DESCRIPTION

    Computes length of underlying linesting in SRID units. 
    If p_unit is provided AND underlying geometry has a non-null SDO_SRID, the length is returned in p_unit units eg Foot

ARGUMENTS

    p_unit (varchar2) - Unit of Measure (UOM) eg Foot, M etc

RESULT

    length (number) - Length of underlying linestring.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.7. T_LRS/ST_LRS_Add_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Add_Measure -- Adds measures to 2D (multi)linestring.

SYNOPSIS

    Member Function ST_LRS_Add_Measure(p_start_measure IN Number Default NULL,
                                       p_end_measure   IN Number Default NULL)
             Return &&INSTALL_SCHEMA..T_LRS deterministic,

DESCRIPTION

    Takes a 2D geometry and assigns supplied measures to the start/end vertices
    and adds proportioned measure values to all vertices in between.

ARGUMENTS

    p_start_measure (Number)   - Measure defining start point for geometry.
    p_end_measure   (Number)   - Measure defining end point for geometry.

RESULT

    geometry (T_LRS) -- Measured geometry

EXAMPLE

    select t_lrs(SDO_GEOMETRY(2002,28355,NULL,
                 SDO_ELEM_INFO_ARRAY(1,2,1),
                 SDO_ORDINATE_ARRAY(
                    571303.231,321126.963, 571551.298,321231.412, 572765.519,321322.805, 572739.407,321845.051,
                    572752.463,322641.476, 573209.428,323398.732, 573796.954,323555.406, 574436.705,323790.416,
                    574945.895,324051.539, 575128.681,324652.122, 575128.681,325161.311, 575898.993,325213.536,
                    576238.453,324521.56, 576251.509,321048.626, 575259.242,322615.364, 574306.144,321296.693)),
                    0.0005,3,1)
             .ST_LRS_ADD_Measure(110.0)
             .ST_Round(3,3,1,2)
             .geom as mGeom
      from dual;

    MGEOM
    ---------------------------------------------------------------------------------------------------------------------------------------
    SDO_GEOMETRY(3302,28355,NULL,
                 SDO_ELEM_INFO_ARRAY(1,2,1),
                 SDO_ORDINATE_ARRAY(
                     571303.231,321126.963,110.0,   571551.298,321231.412,377.21,   572765.519,321322.805,1586.05,  572739.407,321845.051,2105.16,
                     572752.463,322641.476,2895.92, 573209.428,323398.732,3773.96,  573796.954,323555.406,4377.62,  574436.705,323790.416,5054.23,
                     574945.895,324051.539,5622.33, 575128.681,324652.122,6245.56,  575128.681,325161.311,6751.06,  575898.993,325213.536,7517.55,
                     576238.453,324521.56,8282.72,  576251.509,321048.626,11730.53, 575259.242,322615.364,13571.62, 574306.144,321296.693,15186.88))
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.8. T_LRS/ST_LRS_Concatenate [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Concatenate -- Concatenates a linestring on to the underlying linestring

SYNOPSIS

    Member Function ST_LRS_Concatenate(p_lrs_segment IN mdsys.sdo_geometry)
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    This function appends the provided lrs segment to the SELF.

ARGUMENTS

    p_lrs_segment (MDSYS.SDO_GEOMETRY) - LRS Linestring.
  RETURN
    concatenated linestring (T_LRS)

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Aug 2017 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.9. T_LRS/ST_LRS_Dim [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Dim -- Tests underlying mdsys.sdo_geometry to see if coordinates include a measure ordinate and returns measure ordinate's position.

SYNOPSIS

    Member Function ST_Lrs_Dim
             Return Integer Deterministic,

DESCRIPTION

    Examines SDO_GTYPE (DLNN etc) measure ordinate position (L) and returns it.

RESULT

    BOOLEAN (Integer) -- L from DLNN.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.10. T_LRS/ST_LRS_Drop_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Drop_Measure -- Removed measure ordinates.

SYNOPSIS

    Member Function ST_LRS_Drop_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Removes measure ordinates so 3302 linestring becomes a 2002 linestring. 

RESULT

    linestring (T_LRS) -- All measures removed

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jul 2021 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.11. T_LRS/ST_LRS_End_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_End_Measure -- Returns M value of last vertex in measured geometry.

SYNOPSIS

    Member Function ST_LRS_End_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Returns end measure associated with last vertex in a measured line-string.
    If the line-string is not measured it returns the length of the linestring.

ARGUMENTS

    p_unit (VarChar2) - Unit of measure for distance calculations.

RESULT

    measure (Number)  - Measure value of first vertex in a measured line-string: 0 if not measured.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.12. T_LRS/ST_LRS_End_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_End_Point -- Returns last vertex in measured geometry.

SYNOPSIS

    Member Function ST_LRS_End_Point
             Return mdsys.sdo_geometry deterministic

DESCRIPTION

    Returns last vertex in a measured line-string.

RESULT

    last vertex (sdo_geometry)  - Last vertex in a measured line-string

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.13. T_LRS/ST_LRS_Find_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Find_Measure -- Snaps input point to measured linestring returning measure value

SYNOPSIS

    Member Function ST_LRS_Find_Measure(p_point in mdsys.sdo_geometry)
             Return mdsys.sdo_ordinate_array Deterministic,

DESCRIPTION

    Given a point near a measured linestring, this function returns the measures
    of all lines that have same distance to the linestring.

ARGUMENTS

    p_point     (MDSYS.SDO_GEOMETRY) - Geometry for which a measure is needed.

RESULT

    measure (MDSYS.SDO_ORDINATE_ARRAY) -- All measures where more than one is closest to line.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.14. T_LRS/ST_LRS_Find_Offset [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Find_Offset -- Returns smallest (perpendicular) offset from supplied point to the linestring.

SYNOPSIS

    Member Function ST_LRS_Find_Offset(p_geom in mdsys.sdo_geometry)
             Return Number Deterministic,

DESCRIPTION

    Given a point this function returns the smallest (perpendicular) offset from
    the point to the line-string.

ARGUMENTS

    p_point (MDSYS.SDO_GEOMETRY) - Point geometry for which a measure is needed.

RESULT

    offset (Number) - Perpendicular offset distance from point to nearest point on line.
                      Value is negative if on left of line; positive if on right.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.15. T_LRS/ST_LRS_Get_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Get_Measure -- The function returns the measure of the supplied point object.

SYNOPSIS

    Static Function ST_LRS_Get_Measure(p_point in mdsys.sdo_geometry)
           Return number deterministic,

DESCRIPTION

    Returns the measure value of a measured point.
    If point 3301, the value of the Z attribute is returned etc.

RESULT

    Measure Value (Number) - Measure value of point (ie 3301, 4301, 4401). If n001 returns NULL.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - June 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.16. T_LRS/ST_LRS_Interpolate_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Interpolate_Point -- Snaps input point to measured linestring returning measure value

SYNOPSIS

    Member Function ST_LRS_Interpolate_Point(p_point in mdsys.sdo_geometry)
             Return mdsys.sdo_ordinate_array Deterministic,

DESCRIPTION

    Given a point near a measured linestring, this function returns the measures
    of all lines that have same distance to the linestring.

ARGUMENTS

    p_point (MDSYS.SDO_GEOMETRY) - Geometry for which a measure is needed.

RESULT

    measure (number) -- All measures where more than one is closest to line.

SEE ALSO

    ST_LRS_Find_Measure
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jul 2021 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.17. T_LRS/ST_LRS_Is_Measure_Decreasing [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Is_Measure_Decreasing -- Checks if M values decrease in value over all of the linestring.

SYNOPSIS

    Member Function ST_LRS_Is_Measure_Decreasing
             Return varchar2 deterministic,

DESCRIPTION

    Checks all measures of all vertices in a linestring from start to end.
    Computes difference between each pair of measures. If all measure differences
    decrease then TRUE is returned, otherwise FALSE. For non-measured line-strings
    the value is always FALSE.

RESULT

    True/False (VarChar2) - TRUE if measures are decreasing, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.18. T_LRS/ST_LRS_Is_Measure_Increasing [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Is_Measure_Increasing -- Checks if M values increase in value over all of the linestring.

SYNOPSIS

    Member Function ST_LRS_Is_Measure_Increasing
             Return varchar2 deterministic,

DESCRIPTION

    Checks all measures of all vertices in a linestring from start to end.
    Computes difference between each pair of measures. If all measure differences
    increase then TRUE is returned, otherwise FALSE. For non-measured line-strings
    the value is always TRUE.

RESULT

    True/False (VarChar2) -- TRUE if measures are increasing, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.19. T_LRS/ST_LRS_Is_Shape_Pt_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Is_Shape_Pt_Measure -- Checks if M value is associated with a vertex.

SYNOPSIS

    Member Function ST_LRS_Is_Shape_Pt_Measure(p_measure in number)
             Return varchar2 deterministic,

DESCRIPTION

    Checks all measures of all vertices in a linestring from start to end to see
    if a measure on a shape vertex has the same measure value as p_measure.
    Uses measure increasing/decreasing to avoid having to test all vertices in linestring.

RESULT

    True/False (VarChar2) -- TRUE if measure exists at a shape vertex.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - July 2017 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.20. T_LRS/ST_LRS_isMeasured [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_isMeasured -- Tests geometry to see if coordinates include a measure.

SYNOPSIS

    Member Function ST_LRS_isMeasured
             Return Integer Deterministic,
    With data as (
      Select T_LRS(sdo_geometry('LINESTRING(0 0,10 0,10 5,10 10,5 10,5 5)',null),0.005,3,1) as tgeom From Dual UNION ALL
      Select T_LRS(sdo_geometry(3002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(0,0,1,10,0,2,10,5,3,10,10,4,5,10,5,5,5,6)),0.005,3,1) as tgeom From Dual UNION ALL
      Select T_LRS(sdo_geometry(3302,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(0,0,1,10,0,2,10,5,3,10,10,4,5,10,5,5,5,6)),0.005,3,1) as tgeom From Dual
    )
    select a.tgeom.ST_GType()          as sdo_gtype,
           a.tgeom.ST_GeometryType()   as geomType,
           a.tgeom.ST_CoordDimension() as coordDim,
           a.tgeom.ST_LRS_isMeasured() as isMeasured
      from data a;

    SDO_GTYPE GEOMTYPE       COORDDIM isMeasured
    --------- -------------- -------- ----------
            2 ST_LINESTRING         2          0
            2 ST_LINESTRING         3          0
            2 ST_LINESTRING         3          1

DESCRIPTION

    Examines SDO_GTYPE (DLNN etc) to see if sdo_gtype has measure ordinate eg 3302 not 3002.

RESULT

    BOOLEAN (Integer) -- 1 is measure ordinate exists, 0 otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.21. T_LRS/ST_LRS_Line_Substring [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Line_Substring -- Converts supplied fractions (0-1) into single point or linestring.

SYNOPSIS

    Member Function ST_LRS_Line_Substring(p_start_fraction in number,
                                          p_start_fraction   in number)

DESCRIPTION

    Wrapper over ST_LRS_Locate_Between

ARGUMENTS

    p_start_fraction (Number)   - Fraction between 0 and 1 defining start point of located geometry.
    p_end_fraction   (Number)   - Fraction between 0 and 1 defining end point of located geometry.

RESULT

    point (T_LRS) - Point or Line between start/end measure with offset.

SEE ALSO

    ST_LRS_Locate_Between
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.22. T_LRS/ST_LRS_Locate_Along [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Locate_Along -- Wrapper over ST_LRS_Locate_Measure

SYNOPSIS

    Member Function ST_LRS_Locate_Along(p_measure in number,
                                        p_offset  in number   default 0)
             Return &&INSTALL_SCHEMA..T_LRS deterministic

ARGUMENTS

    p_measure (Number)   - Measure defining point to be located.
    p_offset  (Number)   - Offset value left (negative) or right (positive) in p_units.

RESULT

    point (T_LRS) - Point at measure/offset.

SEE ALSO

    ST_Locate_Measure(p_measure in number, ...)
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.23. T_LRS/ST_LRS_Locate_Between [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Locate_Between -- Converts supplied measures into single point or linestring.

SYNOPSIS

    Member Function ST_LRS_Locate_Between(p_start_measure in number,
                                          p_end_measure   in number,
                                          p_offset        in number default 0,
                                          p_unit          varchar2 default null)

DESCRIPTION

    Wrapper over ST_LRS_Locate_Between

ARGUMENTS

    p_start_measure (Number)   - Measure defining start point of located geometry.
    p_end_measure   (Number)   - Measure defining end point of located geometry.
    p_offset        (Number)   - Offset value left (negative) or right (positive).
    p_unit          (VarChar2) - Unit of measure for distance calculations when defining snap point

RESULT

    point (T_LRS) - Point or Line between start/end measure with offset.

SEE ALSO

    ST_Locate_Between(p_start_measure in number, 
                      p_end_measure   in number,
                      p_offset        in number default 0,
                      p_unit          varchar2 default null)
    ST_Locate_Between(p_start_measure in number, ...)
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.24. T_LRS/ST_LRS_Locate_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Locate_Measure -- Returns point geometry at supplied measure along linestring.

SYNOPSIS

    Member Function ST_LRS_Locate_Measure (p_measure in number,
                                           p_offset  in number default 0)
             Return mdsys.sdo_geometry

DESCRIPTION

    Given a measure or length, this function returns a mdsys.sdo_geometry point
    at that measure or offset the supplied amount.

NOTES

    Handles line-strings with reversed measures.

ARGUMENTS

    p_measure (Number)   - Measure defining point to be located.
    p_offset  (Number)   - Offset value left (negative) or right (positive) .

RESULT

    point (T_LRS) - Point at measure/offset.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.25. T_LRS/ST_LRS_Locate_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Locate_Point -- Wrapper over ST_LRS_Locate_Measure

SYNOPSIS

    Member Function ST_LRS_Locate_Point (p_measure in number,
                                         p_offset  in number default 0)
             Return mdsys.sdo_geometry deterministic,

DESCRIPTION

    Given a measure or length, this function returns a mdsys.sdo_geometry point
    at that measure or offset the supplied amount.

NOTES

    Handles line-strings with reversed measures.

ARGUMENTS

    p_measure (Number)   - Measure defining point to be located.
    p_offset  (Number)   - Offset value left (negative) or right (positive).

RESULT

    point (T_LRS) - Point at measure/offset.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - July 2017 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.26. T_LRS/ST_LRS_Locate_PT [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Locate_PT -- Wrapper over ST_LRS_Locate_Measure

SYNOPSIS

    Member Function ST_LRS_Locate_PT (p_measure in number,
                                      p_offset  in number default 0)
             Return mdsys.sdo_geometry deterministic,

DESCRIPTION

    Given a measure or length, this function returns a mdsys.sdo_geometry point
    at that measure or offset the supplied amount.

NOTES

    Handles line-strings with reversed measures.

ARGUMENTS

    p_measure (Number)   - Measure defining point to be located.
    p_offset  (Number)   - Offset value left (negative) or right (positive).

RESULT

    point (T_LRS) - Point at measure/offset.

SEE ALSO

    ST_LRS_Locate_Point
    ST_LRS_Locate_Measure

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - July 2017 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.27. T_LRS/ST_LRS_Measure_Range [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Measure_Range -- Returns Last Vertex M Value - First Vertex M Value.

SYNOPSIS

    Member Function ST_LRS_Measure_Range(p_unit in varchar2 default null)
             Return Number deterministic,

DESCRIPTION

    Returns end vertex measure value - start vertex measure value.
    If line-string not measured, returns length of line.

ARGUMENTS

    p_unit (VarChar2) - Unit of measure for distance calculations.

RESULT

    measure (Number) -- Measure range for measured line-string: length if not measured.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.28. T_LRS/ST_LRS_Measure_To_Percentage [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Measure_To_Percentage -- Converts supplied M value to percentage of M range.

SYNOPSIS

    Member Function ST_LRS_Measure_To_Percentage(p_measure IN Number DEFAULT 0)
             Return Number deterministic,

DESCRIPTION

    The end measure minus the start measure of a measured line-string defines
    the range of the measures (see ST_Measure_Range). The supplied measure is
    divided by this range and multiplied by 100 to return the measure as a percentage.
    For non measured line-strings all values are computed using lengths.

ARGUMENTS

    p_percentage (Number)   - Value between 0 and 100
    p_unit       (VarChar2) - Unit of measure for distance calculations.

RESULT

    Percentage (Number) - Value between 0 and 100.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.29. T_LRS/ST_LRS_Percentage_To_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Percentage_To_Measure -- Converts supplied Percentage value to Measure.

SYNOPSIS

    Member Function ST_LRS_Percentage_To_Measure(p_percentage IN Number DEFAULT 0)
             Return Number deterministic,

DESCRIPTION

    The supplied percentage value (between 0 and 100) is multipled by
    the measure range (see ST_Measure_Range) to return a measure value between
    the start and end measures. For non measured line-strings all values are
    computed using lengths.

ARGUMENTS

    p_percentage (Number)   - Value between 0 and 100

RESULT

    Measure (Number) - Value between Start Measure and End Measure.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

1.30. T_LRS/ST_LRS_Project_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Project_Point -- The function snaps a point to a measured (multi)linestring.

SYNOPSIS

    Member Function ST_LRS_Project_Point(P_Point In Mdsys.Sdo_Geometry)
             Return mdsys.sdo_geometry

DESCRIPTION

    This is a wrapper function for ST_Snap. The function uses ST_Snap to snap a point
    to a linestring(2002) or multi-linestring (2006).
    However, where ST_Snap may return more than one result point if p_point was
    equidistant from two separate segments/segments of the line-string, ST_Project_Point
    returns the first.

ARGUMENTS

    p_point (mdsys.sdo_geometry) - A point(2001) mdsys.sdo_geometry object describing the point for splitting the linestring.

RESULT

    snapped_point (mdsys.sdo_geometry) -- Point where p_point has snapped to the linestring.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.31. T_LRS/ST_LRS_Reset_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Reset_Measure -- Wipes all existing assigned measures.

SYNOPSIS

    Member Function ST_LRS_Reset_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Sets all measures of a measured linesting to null values leaving sdo_gtype
    alone. So, 3302 remains 3302, but all measures are set to NULL eg
    Coord 2 of 10.23,5.75,2.65 => 10.23,5.75,NULL

NOTES

    This is not the same as ST_To2D which removes measures etc and returns a pure 2D (200x object).

RESULT

    linestring (T_LRS) -- All measures reset

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.32. T_LRS/ST_LRS_Reverse_Geometry [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Reverse_Geometry -- Reverses geometry ordinates: first becomes last, second becomes second last etc.

SYNOPSIS

    Member Function ST_LRS_Reverse_Geometry
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Reverses geometry coordinates whereby first becomes last, second becomes second last etc.
    This is not the same as ST_LRS_Reverse_Measure which reverses measures in a linestring while keeping same XY ordering.

RESULT

    linestring (T_LRS) - All coordinates reversed

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.33. T_LRS/ST_LRS_Reverse_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Reverse_Measure -- Reverses vertices measures: first becomes last, second becomes second last etc.

SYNOPSIS

    Member Function ST_LRS_Reverse_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Reverses vertices measures: first becomes last, second becomes second last etc.
    This is not the same as ST_Reverse_Linestring which reverses xy direction of whole linestring.

RESULT

    linestring (T_LRS) - All measures reversed

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.34. T_LRS/ST_LRS_Scale_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Scale_Measure -- Rescales geometry measures and optionally offsets them, stretching the geometry.

SYNOPSIS

    Member Function ST_LRS_Scale_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    This function can redistribute measure values between the supplied
    p_start_measure (start vertex) and p_end_measure (end vertex) by adjusting/scaling
    the measure values of all in between coordinates. In addition, if p_shift_measure
    is not 0 (zero), the supplied value is added to each modified measure value
    performing a translation/shift of those values.

ARGUMENTS

    p_start_measure (Number) - Measure defining start point for geometry.
    p_end_measure   (Number) - Measure defining end point for geometry.
    p_shift_measure (Number) - Unit of measure for distance calculations.
  RETURN
    linestring (T_LRS) - All measures scales.

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.35. T_LRS/ST_LRS_Snap [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Snap -- The function uses ST_Project_Point to snap a point to a (multi)linestring.

SYNOPSIS

    Member Function ST_LRS_Snap(P_Point In Mdsys.Sdo_Geometry)
             Return mdsys.sdo_geometry

DESCRIPTION

    This is a wrapper function for ST_Project_Point. The function snaps a point
    to a linestring or multi-linestring.

ARGUMENTS

    p_point (mdsys.sdo_geometry) - A point(2001) mdsys.sdo_geometry object describing the point for splitting the linestring.

RESULT

    snapped_point (mdsys.sdo_geometry) -- Point where p_point has snapped to the linestring.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2021 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.36. T_LRS/ST_LRS_Split_By_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Split_By_Measure -- Splits a linestring into two parts at the supplied point.

SYNOPSIS

    Member Procedure ST_LRS_Split_By_Measure( p_measure  in  number,
                                              p_segment_1 out nocopy mdsys.sdo_geometry,
                                              p_segment_2 out nocopy mdsys.sdo_geometry)

DESCRIPTION

    Given a measure value between the start and end measures of the underlying linestring, this procedure splits the linestring at that measure.
    If the measure is at start or end of the linestring, the whole geometry is returned in p_segment_1.

ARGUMENTS

    p_measure   (number) - Split measure between start_measure and end_measure inclusive.

RESULT

    p_segment_1 (mdsys.sdo_geometry) - First half of resulting linestring.
    p_segment_2 (mdsys.sdo_geometry) - Second part of resulting linestring could be null if p_point is at start/end of source linestring.

SEE ALSO

    ST_LRS_Split_By_Point
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jul 2021 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.37. T_LRS/ST_LRS_Split_By_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Split_By_Point -- Splits a linestring into two parts at the supplied point.

SYNOPSIS

    Member Procedure ST_LRS_Split_By_Point( p_point  in  mdsys.sdo_geometry,
                                            p_segment_1 out nocopy mdsys.sdo_geometry,
                                            p_segment_2 out nocopy mdsys.sdo_geometry)

DESCRIPTION

    Given a point geometry, this procedure snaps it to the underlying linestring, then splits the linestring at that point.
    If the point snaps to the start or end of the linestring, the whole geometry is returned in p_segment_1.

ARGUMENTS

    p_point     (mdsys.sdo_geometry) - Split point.

RESULT

    p_segment_1 (mdsys.sdo_geometry) - First half of resulting linestring.
    p_segment_2 (mdsys.sdo_geometry) - Second part of resulting linestring could be null if p_point is at start/end of source linestring.

SEE ALSO

    ST_LRS_Split_By_measure
  NOTE
    PostGIS wrapper

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jul 2021 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.38. T_LRS/ST_LRS_Start_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Start_Measure -- Returns M value of first vertex in measured geometry.

SYNOPSIS

    Member Function ST_LRS_Start_Measure
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Returns start measure associated with first vertex in a measured line-string.
    If the line-string is not measured it returns 0.

RESULT

    measure (Number) -- Measure value of first vertex in a measured line-string: 0 if 2D.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.39. T_LRS/ST_LRS_Start_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Start_Point -- Returns first vertex in measured geometry.

SYNOPSIS

    Member Function ST_LRS_Start_Point
             Return mdsys.sdo_geometry Deterministic,

DESCRIPTION

    Returns firsst vertex in a measured line-string.

RESULT

    last vertex (sdo_geometry)  - First vertex in a measured line-string

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jul 2021 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.40. T_LRS/ST_LRS_Translate_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Translate_Measure -- Translating original geometry by shifting the start and end measures by the specified value.

SYNOPSIS

    Member Function ST_LRS_Translate_Measure
             Return &&INSTALL_SCHEMA..T_LRS

DESCRIPTION

    Adds p_translate_m to the start and end measures of geom_segment. 
    SO, if start measure is 10 and end measure is 1200, translating by -10 would return a new geometry with start measure of 0 and end measure of 1100.

RESULT

    linestring (mdsys.sdo_geometry) -- Measures translated.

AUTHOR

    Simon Greener

HISTORY

     Simon Greener - Jul 2021 - Original Coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.41. T_LRS/ST_LRS_Valid_Geometry [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Valid_Geometry -- Checks if underlying LRS linestring is valid.

SYNOPSIS

    Member Function ST_LRS_Valid_Geometry(p_dimarray in mdsys.sdo_dim_array)
             Return varchar2 Deterministic,

DESCRIPTION

    Function returns TRUE string if underlying linestring is a valid LRS linestring and FALSE otherwise.
    The supplied SDO_DIM_ARRAY must have measure information with a SDO_DIMNAME of M (uppercase)
    This function checks that the geometry type is measured eg 3302 and has the right number of dimensions (dL0N)
    The function also checks that sdo_ordinate array has measure values within the range of the supplied diminfo structure.

ARGUMENTS

    p_dimarray (mdsys.sdo_dim_array) - DIMINFO structure with a measure sdo_dim_element

TODO

    Current implementation does NOT examine the supplied diminfo array.

RESULT

    TRUE/FASE (string) - TRUE if LRS linestring is Valid, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.42. T_LRS/ST_LRS_Valid_Measure [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Valid_Measure -- Checks if supplied measure falls within the linestring's measure range.

SYNOPSIS

    Member Function ST_LRS_Valid_Measure(p_measure in number)
             Return varchar2 Deterministic,

DESCRIPTION

    Function returns TRUE string if measure falls within the underlying linestring's measure range
    or the FALSE string if the supplied measure does not fall within the measure range.

ARGUMENTS

    p_measure (number) - Measure value.

RESULT

    TRUE/FASE (string) - TRUE if measure within range, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.43. T_LRS/ST_LRS_Valid_Point [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Valid_Point -- Checks if underlying LRS point is valid.

SYNOPSIS

    Member Function ST_LRS_Valid_Point(p_dimarray in mdsys.sdo_dim_array)
             Return varchar2 Deterministic,

DESCRIPTION

    Function returns TRUE string if point is valid and FALSE if point is not valid.
    A valid LRS point has measure information. It is checkeds for the geometry type
    (point) and the number of dimensions.
    The Oracle equivalent for this function requires that "All LRS point data must be
    stored in the SDO_ELEM_INFO_ARRAY and SDO_ORDINATE_ARRAY, and cannot be stored in
    the SDO_POINT field in the SDO_GEOMETRY definition of the point", however, this
    implementation allows for the storage of 3301 Points within the SDO_POINT_TYPE structure.

ARGUMENTS

    p_dimarray (mdsys.sdo_dim_array) - DIMINFO structure with a measure sdo_dim_element

TODO

    Current implementation does NOT examine the supplied diminfo array.

RESULT

    TRUE/FASE (string) - TRUE if LRS POint is Valid, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.44. T_LRS/ST_LRS_Valid_Segment [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_LRS_Valid_Segment -- Checks if underlying LRS linestring is valid.

SYNOPSIS

    Member Function ST_LRS_Valid_Segment(p_dimarray in mdsys.sdo_dim_array)
             Return varchar2 Deterministic,

DESCRIPTION

    Function returns TRUE string if underlying linestring is a valid LRS linestring and FALSE otherwise.
    The supplied SDO_DIM_ARRAY must have measure information with a SDO_DIMNAME of M (uppercase)
    This function only checks that the geometry type is measured eg 3302 and the linestring dims (dL0N)

ARGUMENTS

    p_dimarray (mdsys.sdo_dim_array) - DIMINFO structure with a measure sdo_dim_element

TODO

    Current implementation does NOT examine the supplied diminfo array.

RESULT

    TRUE/FASE (string) - TRUE if LRS linestring is Valid, FALSE otherwise.

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.45. T_LRS/ST_Release [ Functions ]

[ Top ] [ T_LRS ] [ Functions ]

NAME

    ST_Release -- Returns Version Number for the code in the type.

SYNOPSIS

    Static Function ST_Release
             Return VarChar2

DESCRIPTION

    This function returns a version or release number for the code when distributed.
    Also includes versions of the databases the code was developed against .

EXAMPLE

    select T_LRS.ST_Release()
      from dual;

    T_LRS.ST_Release()
    -----------------------
    2.1.1 Databases(11.2, 12.1)

RESULT

    Code Release Number (VarChar2) - eg 2.2.1 Databases(11.2, 12.1)

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - June 2017 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener

1.46. T_LRS/ST_Round [ Methods ]

[ Top ] [ T_LRS ] [ Methods ]

NAME

    ST_Round -- Rounds X,Y,Z and m (w) ordinates to passed in decimal digits of precision.

SYNOPSIS

    Member Function ST_Round(p_dec_places_x in integer default null,
                             p_dec_places_y in integer default null,
                             p_dec_places_z in integer default null,
                             p_dec_places_m in integer default null)
             Return &&INSTALL_SCHEMA..T_LRS Deterministic,

DESCRIPTION

    Applies relevant decimal digits of precision value to ordinates of mdsys.sdo_geometry.

ARGUMENTS

    p_dec_places_x (integer) - value applied to x Ordinate.
    p_dec_places_y (integer) - value applied to y Ordinate.
    p_dec_places_z (integer) - value applied to z Ordinate.
    p_dec_places_m (integer) - value applied to m Ordinate.

RESULT

    geometry (T_LRS)

AUTHOR

    Simon Greener

HISTORY

    Simon Greener - Jan 2013 - Original coding.

COPYRIGHT

    (c) 2005-2021 by TheSpatialDBAdvisor/Simon Greener