26.36 SDO_LRS.REDEFINE_GEOM_SEGMENT
Format
SDO_LRS.REDEFINE_GEOM_SEGMENT( geom_segment IN OUT SDO_GEOMETRY [, start_measure IN NUMBER, end_measure IN NUMBER]);
or
SDO_LRS.REDEFINE_GEOM_SEGMENT( geom_segment IN OUT SDO_GEOMETRY, dim_array IN SDO_DIM_ARRAY [, start_measure IN NUMBER, end_measure IN NUMBER]);
Description
Populates the measures of all shape points based on the start and end measures of a geometric segment, overriding any previously assigned measures between the start point and end 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). - start_measure
-
Distance measured from the start point of a geometric segment to the start point of the linear feature. The default is the existing value (if any) in the measure dimension; otherwise, the default is 0.
- end_measure
-
Distance measured from the end point of a geometric segment to the start point of the linear feature. The default is the existing value (if any) in the measure dimension; otherwise, the default is the cartographic length of the segment.
Usage Notes
An exception is raised if geom_segment
has an invalid geometry type or dimensionality, or if start_measure
or end_measure
is out of range.
The _3D format of this procedure (SDO_LRS.REDEFINE_GEOM_SEGMENT_3D) is available. For information about _3D formats of LRS functions and procedures, see 3D Formats of LRS Functions.
For more information about redefining a geometric segment, see Redefining a Geometric Segment.
Examples
The following example redefines a geometric segment, effectively converting miles to kilometers in the measure values. (This example uses the definitions from the example in Example of LRS Functions.)
-- First, display the original segment; then, redefine. SELECT a.route_geometry FROM lrs_routes a WHERE a.route_id = 1; ROUTE_GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDIN -------------------------------------------------------------------------------- SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 0, 2, 4, 2, 8, 4, 8, 12, 4, 12, 12, 10, 18, 8, 10, 22, 5, 14, 27)) -- Redefine geometric segment to "convert" miles to kilometers. DECLARE geom_segment SDO_GEOMETRY; dim_array SDO_DIM_ARRAY; BEGIN SELECT a.route_geometry into geom_segment FROM lrs_routes a WHERE a.route_name = 'Route1'; SELECT m.diminfo into dim_array from user_sdo_geom_metadata m WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY'; -- "Convert" mile measures to kilometers (27 * 1.609 = 43.443). SDO_LRS.REDEFINE_GEOM_SEGMENT (geom_segment, dim_array, 0, -- Zero starting measure: LRS segment starts at start of route. 43.443); -- End of LRS segment. 27 miles = 43.443 kilometers. -- Update and insert geometries into table, to display later. UPDATE lrs_routes a SET a.route_geometry = geom_segment WHERE a.route_id = 1; END; / PL/SQL procedure successfully completed. -- Display the redefined segment, with all measures "converted." SELECT a.route_geometry FROM lrs_routes a WHERE a.route_id = 1; ROUTE_GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDIN -------------------------------------------------------------------------------- SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 0, 2, 4, 3.218, 8, 4, 12.872, 12, 4, 19.308, 12, 10, 28.962, 8, 10, 35.398 , 5, 14, 43.443))
Parent topic: SDO_LRS Package (Linear Referencing System)