26.32 SDO_LRS.MEASURE_TO_PERCENTAGE
Format
SDO_LRS.MEASURE_TO_PERCENTAGE( geom_segment IN SDO_GEOMETRY, measure IN NUMBER ) RETURN NUMBER;
or
SDO_LRS.MEASURE_TO_PERCENTAGE( geom_segment IN SDO_GEOMETRY, dim_array IN SDO_DIM_ARRAY, measure IN NUMBER ) RETURN NUMBER;
Description
Returns the percentage (0 to 100) that a specified measure is of the measure range of a geometric segment.
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). - measure
-
Measure value. This function returns the percentage that this measure value is of the measure range.
Usage Notes
This function returns a number (0 to 100) that is the percentage of the measure range that the specified measure represents. (The measure range is the end measure minus the start measure.) For example, if the measure range of geom_segment
is 50 and measure
is 20, the function returns 40 (because 20/50 = 40%).
This function performs the reverse of the SDO_LRS.PERCENTAGE_TO_MEASURE function, which returns the measure that corresponds to a percentage value.
An exception is raised if geom_segment
or measure
is invalid.
Examples
The following example returns the percentage that 5 is of the measure range of the geometric segment representing Route 1. (This example uses the definitions from the example in Example of LRS Functions.) The measure range of this segment is 27, and 5 is approximately 18.5 percent of 27.
SELECT SDO_LRS.MEASURE_TO_PERCENTAGE(a.route_geometry, m.diminfo, 5) 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.MEASURE_TO_PERCENTAGE(A.ROUTE_GEOMETRY,M.DIMINFO,5) ----------------------------------------------------------- 18.5185185
Parent topic: SDO_LRS Package (Linear Referencing System)