26.13 SDO_LRS.FIND_MEASURE

Format

SDO_LRS.FIND_MEASURE(
     geom_segment IN SDO_GEOMETRY, 
     point        IN SDO_GEOMETRY 
     ) RETURN NUMBER;

or

SDO_LRS.FIND_MEASURE(
     geom_segment IN SDO_GEOMETRY, 
     dim_array    IN SDO_DIM_ARRAY, 
     point        IN SDO_GEOMETRY 
     ) RETURN NUMBER;

Description

Returns the measure of the closest point on a segment to a specified projection point.

Parameters

geom_segment

Geometric segment (LRS segment) containing measure information.

dim_array

Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Geometry Metadata Views).

point

Projection point. This function returns the measure of the point on geom_segment that is closest to the projection point.

Usage Notes

This function returns the measure of the point on geom_segment that is closest to the projection point. For example, if the projection point represents a shopping mall, the function could be used to find how far from the start of the highway is the point on the highway that is closest to the shopping mall.

An exception is raised if geom_segment has an invalid geometry type or dimensionality, or if geom_segment and point are based on different coordinate systems.

The _3D format of this function (SDO_LRS.FIND_MEASURE_3D) is available. For information about _3D formats of LRS functions, see 3D Formats of LRS Functions.

Examples

The following example finds the measure for the point on the geometric segment representing Route 1 that is closest to the point (10, 7). (This example uses the definitions from the example in Example of LRS Functions.)

-- Find measure for point on segment closest to 10,7.
-- Should return 15 (for point 12,7).
SELECT  SDO_LRS.FIND_MEASURE(a.route_geometry, m.diminfo,
  SDO_GEOMETRY(3001, NULL, NULL, 
     SDO_ELEM_INFO_ARRAY(1, 1, 1), 
     SDO_ORDINATE_ARRAY(10, 7, NULL)) )
 FROM lrs_routes a, user_sdo_geom_metadata m
 WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY'
   AND a.route_id = 1;

SDO_LRS.FIND_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,SDO_GEOMETRY(3001,NULL,NUL
--------------------------------------------------------------------------------
                                                                              15