Oracle Spatial User's Guide and Reference Release 8.1.7 Part Number A85337-01 |
|
The MDSYS.SDO_LRS package contains functions that create, modify, query, and convert linear referencing elements. These functions do not change the state of the database.
To use the functions in this chapter, you must understand the linear referencing system (LRS) concepts and techniques described in Appendix E.
Table 9-1 lists functions related to creating and editing geometric segments.
Function | Description |
---|---|
SDO_LRS.DEFINE_GEOM_SEGMENT (procedure) |
Defines a geometric segment. |
SDO_LRS.REDEFINE_GEOM_SEGMENT (procedure) |
Populates the measures of all shape points of a geometric segment based on the start and end measures, overriding any previously assigned measures between the start point and end point. |
Clips a geometric segment (synonym of SDO_LRS.DYNAMIC_SEGMENT). |
|
Clips a geometric segment (synonym of SDO_LRS.CLIP_GEOM_SEGMENT). |
|
Concatenates two geometric segments into one segment. |
|
Scales a geometric segment. |
|
SDO_LRS.SPLIT_GEOM_SEGMENT (procedure) |
Splits a geometric segment into two segments. |
Returns a new geometric segment by reversing the original geometric segment. |
|
Returns a new geometric segment by translating the original geometric segment (that is, shifting the start and end measures by a specified value). |
Table 9-2 lists functions related to querying geometric segments.
Table 9-3 lists functions related to converting geometric segments.
For more information about conversion functions, see Section E.4.9.
The rest of this chapter provides reference information on the functions, listed in alphabetical order.
Note: Error messages for linear referencing functions are documented in Section E.6. (They are not included in the Oracle8i Error Messages manual for release 8.1.7.) |
SDO_LRS.CLIP_GEOM_SEGMENT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
Returns the geometry object resulting from a clip operation on a geometric segment.
Note: CLIP_GEOM_SEGMENT and SDO_LRS.DYNAMIC_SEGMENT are synonyms: both functions have the same parameters, behavior, and return value. |
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Start measure of the geometric segment.
End measure of the geometric segment.
An exception is raised if geom_segment, start_measure, or end_measure is invalid.
The direction and measures of the resulting geometric segment are preserved.
For more information about clipping geometric segments, see Section E.4.3
The following example clips the geometric segment representing Route 1, returning the segment from measures 5 through 10. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.CLIP_GEOM_SEGMENT(a.route_geometry, m.diminfo, 5, 10) 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.CLIP_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,5,10)(SDO_GTYPE, SDO_SRID, -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 5, 4, 5, 8, 4, 8, 10, 4, 10))
SDO_LRS.CONCATENATE_GEOM_SEGMENTS(
geom_segment_1 IN MDSYS.SDO_GEOMETRY,
dim_array_1 IN MDSYS.SDO_DIM_ARRAY,
geom_segment_2 IN MDSYS.SDO_GEOMETRY,
dim_array_2 IN MDSYS.SDO_DIM_ARRAY
) RETURN MDSYS.SDO_GEOMETRY;
Returns the geometry object resulting from the concatenation of two geometric segments.
First geometric segment to be concatenated.
Dimensional information array corresponding to geom_segment_1, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Second geometric segment to be concatenated.
Dimensional information array corresponding to geom_segment_2, usually selected from one of the xxx_SDO_GEOM_METADATA views.
An exception is raised if geom_segment_1 or geom_segment_2 is invalid, or if the end point of the first segment and the start point of the second segment are not spatially connected.
The direction of the resulting geometric segment is preserved, and all measures of the second segment are shifted so that its start measure is the same as the end measure of the first segment.
For more information about concatenating geometric segments, see Section E.4.5
The following example defines the geometric segment, splits it into two segments, then concatenates those segments. (This example uses the definitions from the example in Section E.5. The definitions of result_geom_1, result_geom_2, and result_geom_3 are displayed in Example E-3.)
DECLARE geom_segment MDSYS.SDO_GEOMETRY; line_string MDSYS.SDO_GEOMETRY; dim_array MDSYS.SDO_DIM_ARRAY; result_geom_1 MDSYS.SDO_GEOMETRY; result_geom_2 MDSYS.SDO_GEOMETRY; result_geom_3 MDSYS.SDO_GEOMETRY; 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'; -- Define the LRS segment for Route1. SDO_LRS.DEFINE_GEOM_SEGMENT (geom_segment, dim_array, 0, -- Zero starting measure: LRS segment starts at start of route. 27); -- End of LRS segment is at measure 27. SELECT a.route_geometry INTO line_string FROM lrs_routes a WHERE a.route_name = 'Route1'; -- Split Route1 into two segments. SDO_LRS.SPLIT_GEOM_SEGMENT(line_string,dim_array,5,result_geom_1,result_geom_2); -- Concatenate the segments that were just split. result_geom_3 := SDO_LRS.CONCATENATE_GEOM_SEGMENTS(result_geom_1, dim_array, result_geom_2, dim_array); -- Insert geometries into table, to display later. INSERT INTO lrs_routes VALUES( 11, 'result_geom_1', result_geom_1 ); INSERT INTO lrs_routes VALUES( 12, 'result_geom_2', result_geom_2 ); INSERT INTO lrs_routes VALUES( 13, 'result_geom_3', result_geom_3 ); END; /
SDO_LRS.CONNECTED_GEOM_SEGMENTS(
geom_segment_1 IN MDSYS.SDO_GEOMETRY,
dim_array_1 IN MDSYS.SDO_DIM_ARRAY,
geom_segment_2 IN MDSYS.SDO_GEOMETRY,
dim_array_2 IN MDSYS.SDO_DIM_ARRAY
) RETURN VARCHAR2;
Checks if two geometric segments are spatially connected.
First of two geometric segments to be checked.
Dimensional information array corresponding to geom_segment_1, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Second of two geometric segments to be checked.
Dimensional information array corresponding to geom_segment_2, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns TRUE if the geometric segments are spatially connected and FALSE if the geometric segments are not spatially connected.
An exception is raised if geom_segment_1 or geom_segment_2 is invalid.
The following example checks if two geometric segments (results of a previous split operation) are spatially connected.
-- Are result_geom_1 and result_geom2 connected? SELECT SDO_LRS.CONNECTED_GEOM_SEGMENTS(a.route_geometry, m.diminfo, b.route_geometry, m.diminfo) FROM lrs_routes a, lrs_routes b, user_sdo_geom_metadata m WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY' AND a.route_id = 1; SDO_LRS.CONNECTED_GEOM_SEGMENTS(A.ROUTE_GEOMETRY,M.DIMINFO,B.ROUTE_GEOMETRY,M.DI -------------------------------------------------------------------------------- TRUE
SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(
dim_array IN MDSYS.SDO_DIM_ARRAY
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN MDSYS.SDO_DIM_ARRAY;
Converts a standard dimensional array to a Linear Referencing System dimensional array by creating a measure dimension.
Dimensional information array corresponding to the layer (column of geometries) to be converted, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Lower bound (SDO_LB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
Upper bound (SDO_UB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
Tolerance (SDO_TOLERANCE value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
This function converts a standard dimensional array to a Linear Referencing System dimensional array by creating a measure dimension. Specifically, it adds an SDO_DIM_ELEMENT object at the end of the current SDO_DIM_ELEMENT objects in the SDO_DIM_ARRAY for the diminfo, and sets the SDO_DIMNAME value in this added SDO_DIM_ELEMENT to M. It sets the other values in the added SDO_DIM_ELEMENT according to the values if the upper_bound, lower_bound, and tolerance parameter values.
If dim_array already contains dimensional information, the dim_array is returned.
For more information about conversion functions, see Section E.4.9.
The following example converts the dimensional array for the LRS_ROUTES table to Linear Referencing System format. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(m.diminfo) FROM user_sdo_geom_metadata m WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY'; SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(M.DIMINFO)(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOL -------------------------------------------------------------------------------- SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 0, 20, .005), SDO_DIM_ELEMENT('Y', 0, 20, .00 5), SDO_DIM_ELEMENT('M', 0, 20, .005))
SDO_LRS.CONVERT_TO_LRS_GEOM(
standard_geom IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY
[, start_measure IN NUMBER,
end_measure IN NUMBER]
) RETURN MDSYS.SDO_GEOMETRY;
Converts a standard SDO_GEOMETRY line string to a Linear Referencing System geometric segment by adding measure information.
Line string geometry that does not contain measure information.
Dimensional information array corresponding to standard_geom, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance measured from the start point of a geometric segment to the start point of the linear feature. The default is 0.
Distance measured from the end point of a geometric segment to the start point of the linear feature. The default is the cartographic length (for example, 75 if the cartographic length is 75 miles and the unit of measure is miles).
This function returns a Linear Referencing System geometric segment with measure information, with measure information provided for all shape points.
An exception is raised if standard_geom is invalid or if start_measure or end_measure is out of range.
For more information about conversion functions, see Section E.4.9.
The following example converts the geometric segment representing Route 1 to Linear Referencing System format. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.CONVERT_TO_LRS_GEOM(a.route_geometry, m.diminfo) 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.CONVERT_TO_LRS_GEOM(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, SDO -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, 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, NULL, 8, 10, 22, 5, 14, 27))
SDO_LRS.CONVERT_TO_LRS_LAYER(
table_name IN VARCHAR2,
column_name IN VARCHAR2
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN VARCHAR2;
Converts all geometry objects in a column of type SDO_GEOMETRY (that is, converts a layer) from standard line string geometries without measure information to Linear Referencing System geometric segments with measure information, and updates the metadata in the USER_SDO_GEOM_METADATA view.
Table containing the column with the SDO_GEOMETRY objects.
Column in table_name containing the SDO_GEOMETRY objects.
Lower bound (SDO_LB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
Upper bound (SDO_UB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
Tolerance (SDO_TOLERANCE value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
This function returns TRUE if the conversion was successful or if the layer already contains measure information, and the function returns an exception if the conversion was not successful.
An exception is raised if the existing dimensional information for the table is invalid.
The measure values are assigned based on a start measure of zero and an end measure of the cartographic length.
For more information about conversion functions, see Section E.4.9.
The following example converts the geometric segments in the ROUTE_GEOMETRY column of the LRS_ROUTES table to Linear Referencing System format. (This example uses the definitions from the example in Section E.5.) The SELECT statement shows that dimensional information has been added (that is, SDO_DIM_ELEMENT('M', NULL, NULL, NULL) included in the definition).
BEGIN IF (SDO_LRS.CONVERT_TO_LRS_LAYER('LRS_ROUTES', 'ROUTE_GEOMETRY') = 'TRUE') THEN DBMS_OUTPUT.PUT_LINE('Conversion from STD_LAYER to LRS_LAYER succeeded'); ELSE DBMS_OUTPUT.PUT_LINE('Conversion from STD_LAYER to LRS_LAYER failed'); END IF; END; . / Conversion from STD_LAYER to LRS_LAYER succeeded PL/SQL procedure successfully completed. SQL> SELECT diminfo FROM user_sdo_geom_metadata WHERE table_name = 'LRS_ROUTES' AND column_name = 'ROUTE_GEOMETRY'; DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE) -------------------------------------------------------------------------------- SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 0, 20, .005), SDO_DIM_ELEMENT('Y', 0, 20, .00 5), SDO_DIM_ELEMENT('M', NULL, NULL, NULL))
SDO_LRS.CONVERT_TO_STD_DIM_ARRAY(
Converts a Linear Referencing System dimensional array to a standard dimensional array by removing the measure dimension.
Dimensional information array corresponding to the layer (column of geometries) to be converted, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function converts a Linear Referencing System dimensional array to a standard dimensional array by removing the measure dimension. Specifically, it removes the SDO_DIM_ELEMENT object at the end of the current SDO_DIM_ELEMENT objects in the SDO_DIM_ARRAY for the diminfo.
If dim_array is already a standard dimensional array (that is, does not contain dimensional information), the dim_array is returned.
For more information about conversion functions, see Section E.4.9.
The following example converts the dimensional array for the LRS_ROUTES table to standard format. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.CONVERT_TO_STD_DIM_ARRAY(m.diminfo) FROM user_sdo_geom_metadata m WHERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY'; SDO_LRS.CONVERT_TO_STD_DIM_ARRAY(M.DIMINFO)(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOL -------------------------------------------------------------------------------- SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 0, 20, .005), SDO_DIM_ELEMENT('Y', 0, 20, .00 5))
SDO_LRS.CONVERT_TO_STD_GEOM(
Converts a Linear Referencing System geometric segment to a standard SDO_GEOMETRY line string by removing measure information.
Linear Referencing System geometry that contains measure information.
Dimensional information array corresponding to lrs_geom, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns an SDO_GEOMETRY object in which all measure information is removed.
For more information about conversion functions, see Section E.4.9.
The following example converts the geometric segment representing Route 1 to standard format. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.CONVERT_TO_STD_GEOM(a.route_geometry, m.diminfo) 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.CONVERT_TO_STD_GEOM(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, SDO -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 2, 4, 8, 4, 12, 4, 12, 10, 8, 10, 5, 14))
SDO_LRS.CONVERT_TO_STD_LAYER(
Converts all geometry objects in a column of type SDO_GEOMETRY (that is, converts a layer) from Linear Referencing System geometric segments with measure information to standard line string geometries without measure information, and updates the metadata in the USER_SDO_GEOM_METADATA view.
Table containing the column with the SDO_GEOMETRY objects.
Column in table_name containing the SDO_GEOMETRY objects.
This function returns TRUE if the conversion was successful or if the layer already is a standard layer (that is, contains geometries without measure information), and the function returns an exception if the conversion was not successful.
An exception is raised if the conversion failed.
For more information about conversion functions, see Section E.4.9.
The following example converts the geometric segments in the ROUTE_GEOMETRY column of the LRS_ROUTES table to standard format. (This example uses the definitions from the example in Section E.5.) The SELECT statement shows that dimensional information has been removed (that is, no SDO_DIM_ELEMENT('M', NULL, NULL, NULL) included in the definition).
BEGIN IF (SDO_LRS.CONVERT_TO_STD_LAYER('LRS_ROUTES', 'ROUTE_GEOMETRY') = 'TRUE') THEN DBMS_OUTPUT.PUT_LINE('Conversion from LRS_LAYER to STD_LAYER succeeded'); ELSE DBMS_OUTPUT.PUT_LINE('Conversion from LRS_LAYER to STD_LAYER failed'); END IF; END; . / Conversion from LRS_LAYER to STD_LAYER succeeded PL/SQL procedure successfully completed. SELECT diminfo FROM user_sdo_geom_metadata WHERE table_name = 'LRS_ROUTES' AND column_name = 'ROUTE_GEOMETRY'; DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE) -------------------------------------------------------------------------------- SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', 0, 20, .005), SDO_DIM_ELEMENT('Y', 0, 20, .00 5))
SDO_LRS.DEFINE_GEOM_SEGMENT(
geom_segment IN OUT MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER);
Defines a geometric segment by assigning start and end measures to a geometric segment. (This is a procedure, not a function.)
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance measured from the start point of a geometric segment to the start point of the linear feature.
Distance measured from the end point of a geometric segment to the start point of the linear feature.
An exception is raised if geom_segment is invalid or if start_measure or end_measure is out of range.
All unassigned measures of the geometric segment will be populated automatically.
For more information about defining a geometric segment, see Section E.4.1
The following example defines the geometric segment, splits it into two segments, then concatenates those segments. (This example uses the definitions from the example in Section E.5. The definitions of result_geom_1, result_geom_2, and result_geom_3 are displayed in Example E-3.)
DECLARE geom_segment MDSYS.SDO_GEOMETRY; line_string MDSYS.SDO_GEOMETRY; dim_array MDSYS.SDO_DIM_ARRAY; result_geom_1 MDSYS.SDO_GEOMETRY; result_geom_2 MDSYS.SDO_GEOMETRY; result_geom_3 MDSYS.SDO_GEOMETRY; 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'; -- Define the LRS segment for Route1. SDO_LRS.DEFINE_GEOM_SEGMENT (geom_segment, dim_array, 0, -- Zero starting measure: LRS segment starts at start of route. 27); -- End of LRS segment is at measure 27. SELECT a.route_geometry INTO line_string FROM lrs_routes a WHERE a.route_name = 'Route1'; -- Split Route1 into two segments. SDO_LRS.SPLIT_GEOM_SEGMENT(line_string,dim_array,5,result_geom_1,result_geom_2); -- Concatenate the segments that were just split. result_geom_3 := SDO_LRS.CONCATENATE_GEOM_SEGMENTS(result_geom_1, dim_array, result_geom_2, dim_array); -- Insert geometries into table, to display later. INSERT INTO lrs_routes VALUES( 11, 'result_geom_1', result_geom_1 ); INSERT INTO lrs_routes VALUES( 12, 'result_geom_2', result_geom_2 ); INSERT INTO lrs_routes VALUES( 13, 'result_geom_3', result_geom_3 ); END; /
SDO_LRS.DYNAMIC_SEGMENT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
Returns the geometry object resulting from a clip operation on a geometric segment.
Note: SDO_LRS.CLIP_GEOM_SEGMENT and SDO_LRS.DYNAMIC_SEGMENT are synonyms: both functions have the same parameters, behavior, and return value. |
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Start measure of the geometric segment.
End measure of the geometric segment.
An exception is raised if geom_segment, start_measure, or end_measure is invalid.
The direction and measures of the resulting geometric segment are preserved.
For more information about clipping a geometric segment, see Section E.4.3
The following example clips the geometric segment representing Route 1, returning the segment from measures 5 through 10. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.DYNAMIC_SEGMENT(a.route_geometry, m.diminfo, 5, 10) 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.DYNAMIC_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,5,10)(SDO_GTYPE, SDO_SRID, -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 5, 4, 5, 8, 4, 8, 10, 4, 10))
SDO_LRS.FIND_MEASURE(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
point IN MDSYS.SDO_GEOMETRY
) RETURN NUMBER;
Returns the measure of the closest point on a segment to a specified projection point.
Cartographic representation of a linear feature. This function returns the measure of the point on this segment that is closest to the projection point.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Projection point. This function returns the measure of the point on geom_segment that is closest to the projection point.
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 or point is invalid.
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 Section E.5.)
-- 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, MDSYS.SDO_GEOMETRY(3001, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1), MDSYS.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,MDSYS.SDO_GEOMETRY(3001,NULL,NUL -------------------------------------------------------------------------------- 15
SDO_LRS.GEOM_SEGMENT_END_MEASURE(
Returns the end measure of a geometric segment.
Geometric segment whose end measure is to be returned.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the end measure of geom_segment.
An exception is raised if geom_segment is invalid.
The following example returns the end measure of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.GEOM_SEGMENT_END_MEASURE(a.route_geometry, m.diminfo) 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.GEOM_SEGMENT_END_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO) ------------------------------------------------------------ 27
SDO_LRS.GEOM_SEGMENT_END_PT(
Returns the end point of a geometric segment.
Geometric segment whose end point is to be returned.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the end point of geom_segment.
An exception is raised if geom_segment is invalid.
The following example returns the end point of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.GEOM_SEGMENT_END_PT(a.route_geometry, m.diminfo) 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.GEOM_SEGMENT_END_PT(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, SDO -------------------------------------------------------------------------------- SDO_GEOMETRY(3001, 0, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(5, 14, 27))
SDO_LRS.GEOM_SEGMENT_LENGTH(
Returns the length of a geometric segment.
Geometric segment whose length is to be calculated.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the length of geom_segment. The length is the geometric length, which is not the same as the total of the measure unit values. To determine how long a segment is in terms of measure units, subtract the result of an SDO_LRS.GEOM_SEGMENT_START_MEASURE operation from the result of an SDO_LRS.GEOM_SEGMENT_END_MEASURE operation.
SDO_LRS.GEOM_SEGMENT_LENGTH is an alias of the SDO_GEOM.SDO_LENGTH Spatial function.
An exception is raised if geom_segment is invalid.
The following example returns the length of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.GEOM_SEGMENT_LENGTH(a.route_geometry, m.diminfo) 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.GEOM_SEGMENT_LENGTH(A.ROUTE_GEOMETRY,M.DIMINFO) ------------------------------------------------------- 27
SDO_LRS.GEOM_SEGMENT_START_MEASURE(
Returns the start measure of a geometric segment.
Geometric segment whose start measure is to be returned.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the start measure of geom_segment.
An exception is raised if geom_segment is invalid.
The following example returns the start measure of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.GEOM_SEGMENT_START_MEASURE(a.route_geometry, m.diminfo) FROM lrs_routes a, user_sdo_geom_metadata m HERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY' AND a.route_id = 1; SDO_LRS.GEOM_SEGMENT_START_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO) -------------------------------------------------------------- 0
SDO_LRS.GEOM_SEGMENT_START_PT(
Returns the start point of a geometric segment.
Geometric segment whose start point is to be returned.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the start point of geom_segment.
An exception is raised if geom_segment is invalid.
The following example returns the start point of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.GEOM_SEGMENT_START_PT(a.route_geometry, m.diminfo) 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.GEOM_SEGMENT_START_PT(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, S -------------------------------------------------------------------------------- SDO_GEOMETRY(3001, 0, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(2, 2, 0))
SDO_LRS.GET_MEASURE(
Returns the measure of a point on a geometric segment.
Point whose measure along its geometric segment is to be returned.
Dimensional information array corresponding to point, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns the measure of a point on the geometric segment.
If point is not valid, an "invalid LRS segment" exception is raised.
Contrast this function with SDO_LRS.PROJECT_PT, which accepts as input a point that is not necessarily on the geometric segment, but which returns a point that is on the geometric segment. As the following example shows, the SDO_LRS.GET_MEASURE function can be used to return the measure of the projected point returned by SDO_LRS.PROJECT_PT.
The following example returns the measure of a projected point. In this case, the point resulting from the projection is 9 units from the start of the segment.
SQL> SELECT SDO_LRS.GET_MEASURE( SDO_LRS.PROJECT_PT(a.route_geometry, m.diminfo, MDSYS.SDO_GEOMETRY(3001, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1), MDSYS.SDO_ORDINATE_ARRAY(9, 3, NULL)) ), m.diminfo ) 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.GET_MEASURE(SDO_LRS.PROJECT_PT(A.ROUTE_GEOMETRY,M.DIMINFO,MDSYS.SDO_GEOM -------------------------------------------------------------------------------- 9
SDO_LRS.IS_GEOM_SEGMENT_DEFINED(
Checks if an LRS segment is defined correctly.
Geometric segment to be checked.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns TRUE if geom_segment is defined correctly and FALSE if geom_segment is not defined correctly.
The start and end measures of geom_segment must be defined (cannot be null), and any measures assigned must be in an ascending order along the segment direction.
See also the SDO_LRS.VALID_GEOM_SEGMENT function.
The following example checks if the geometric segment representing Route 1 is defined. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.IS_GEOM_SEGMENT_DEFINED(a.route_geometry, m.diminfo) 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.IS_GEOM_SEGMENT_DEFINED(A.ROUTE_GEOMETRY,M.DIMINFO) -------------------------------------------------------------------------------- TRUE
SDO_LRS.LOCATE_PT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
measure IN NUMBER,
offset IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
Returns the point located at a specified distance from the start of a geometric segment.
Geometric segment to be checked to see if it falls within the measure range of measure.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance to measure from the start point of geom_segment.
Distance to measure perpendicularly from the point that is located at measure units from the start point of geom_segment.
This function returns the referenced point.
An exception is raised if geom_segment is invalid or if the location is out of range.
For more information about locating a point on a geometric segment, see Section E.4.7.
The following example returns the point at measure 9 and on (that is, offset 0) the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.LOCATE_PT(a.route_geometry, m.diminfo, 9, 0) 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.LOCATE_PT(A.ROUTE_GEOMETRY,M.DIMINFO,9,0)(SDO_GTYPE, SDO_SRID, SDO_POINT -------------------------------------------------------------------------------- SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY( 9, 4, 9))
SDO_LRS.MEASURE_RANGE(
Returns the measure range of a geometric segment, that is, the difference between the start measure and end measure.
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function subtracts the start measure of geom_segment from the end measure of geom_segment.
The following example returns the measure range of the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.MEASURE_RANGE(a.route_geometry, m.diminfo) 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_RANGE(A.ROUTE_GEOMETRY,M.DIMINFO) ------------------------------------------------- 27
SDO_LRS.MEASURE_TO_PERCENTAGE(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN NUMBER;
Returns the percentage (0 to 100) that a specified measure is of the measure range of a geometric segment.
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Measure value. This function returns the percentage that this measure value is of the measure range.
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.
The following example returns the percentage that 5 is of the measure range of geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.) 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
SDO_LRS.PERCENTAGE_TO_MEASURE(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
percentage IN NUMBER
) RETURN NUMBER;
Returns the measure value of a specified percentage (0 to 100) of the measure range of a geometric segment.
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Percentage value. Must be from 0 to 100. This function returns the measure value corresponding to this percentage of the measure range.
This function returns the measure value corresponding to this percentage of the measure range. (The measure range is the end measure minus the start measure.) For example, if the measure range of geom_segment is 50 and percentage is 40, the function returns 20 (because 40% of 50 = 20).
This function performs the reverse of the SDO_LRS.MEASURE_TO_PERCENTAGE function, which returns the percentage value that corresponds to a measure.
An exception is raised if geom_segment is invalid or if percentage is less than 0 or greater than 100.
The following example returns the measure that is 50 percent of the measure range of geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.) The measure range of this segment is 27, and 50 percent of 17 is 13.5.
SELECT SDO_LRS.PERCENTAGE_TO_MEASURE(a.route_geometry, m.diminfo, 50) FROM lrs_routes a, user_sdo_geom_metadata m HERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY' AND a.route_id = 1; SDO_LRS.PERCENTAGE_TO_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,50) ------------------------------------------------------------ 13.5
SDO_LRS.PROJECT_PT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
point IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY;
Returns the projection point of a point on a geometric segment.
Geometric segment to be checked.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Point to be projected.
This function returns the projection point (including its measure) of a specified point (point). The projection point is on the geometric segment.
If multiple projection points exist, the first projection point encountered from the start point is returned.
An exception is raised if geom_segment is invalid.
For more information about projecting a point onto a geometric segment, see Section E.4.8.
The following example returns the point (9,4,9) on the geometric segment representing Route 1 that is closest to the specified point (9,3,NULL). (This example uses the definitions from the example in Section E.5.)
-- Point 9,3,NULL is off the road; should return 9,4,9 SELECT SDO_LRS.PROJECT_PT(a.route_geometry, m.diminfo, MDSYS.SDO_GEOMETRY(3001, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1), MDSYS.SDO_ORDINATE_ARRAY(9, 3, NULL)) ) FROM lrs_routes a, user_sdo_geom_metadata m HERE m.table_name = 'LRS_ROUTES' AND m.column_name = 'ROUTE_GEOMETRY' AND a.route_id = 1; SDO_LRS.PROJECT_PT(A.ROUTE_GEOMETRY,M.DIMINFO,MDSYS.SDO_GEOMETRY(3001,NULL,NULL, -------------------------------------------------------------------------------- SDO_GEOMETRY(3001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY( 9, 4, 9))
SDO_LRS.REDEFINE_GEOM_SEGMENT(
geom_segment IN OUT MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY
[, start_measure IN NUMBER,
end_measure IN NUMBER]);
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.
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance measured from the start point of a geometric segment to the start point of the linear feature. The default is 0.
Distance measured from the end point of a geometric segment to the start point of the linear feature. The default is the cartographic distance of the segment.
An exception is raised if geom_segment is invalid or if start_measure or end_measure is out of range.
For more information about redefining a geometric segment, see Section E.4.2.
The following example redefines a geometric segment. (This example uses the definitions from the example in Section E.5.)
DECLARE geom_segment MDSYS.SDO_GEOMETRY; dim_array MDSYS.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'; -- Define the LRS segment for Route1. SDO_LRS.REDEFINE_GEOM_SEGMENT (geom_segment, dim_array, 0, -- Zero starting measure: LRS segment starts at start of route. 27); -- End of LRS segment is at measure 27. END; /
SDO_LRS.REVERSE_MEASURE(
Returns a new geometric segment by reversing the original geometric segment.
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function reverses the start and end measures (and consequently the direction) of geom_segment. That is, the start measure of geom_segment is the end measure of the returned geometric segment, and the end measure of geom_segment is the start measure of the returned geometric segment.
Figure 9-1 shows the reversal of the start and end measures and the segment direction resulting from this function.
An exception is raised if geom_segment is invalid.
The following example reverses the geometric segment representing route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.REVERSE_MEASURE(a.route_geometry, m.diminfo) 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.REVERSE_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, SDO_POI -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 5, 14, 0, 8, 10, 5, 12, 10, 9, 12, 4, 15, 8, 4, 19, 2, 4, 25, 2, 2, 27))
SDO_LRS.SCALE_GEOM_SEGMENT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER,
shift_measure IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
Returns the geometry object resulting from the scaling of a geometric segment.
Geometric segment to be scaled.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Start measure of the scaled geometric segment.
End measure of the scaled geometric segment.
Shift measure of the scaled geometric segment.
This function performs a general scaling operation to the geometric segment. The new start and end measures are assigned, and all measures are populated by a linear mapping between old and new start and end measures. The shift measure is applied to the segment after scaling.
Common uses of this function are:
The examples illustrate these uses.
An exception is raised if geom_segment is invalid or if start_measure or end_measure is out of range.
For more information about scaling a geometric segment, see Section E.4.6.
The following examples illustrate the common SCALE_GEOM_ELEMENT uses described in the Usage Notes. (These examples use the definitions from the example in Section E.5.)
-- Shift by 5 (for example, 5-mile segment added before original start) SELECT SDO_LRS.SCALE_GEOM_SEGMENT(a.route_geometry, m.diminfo, 0, 27, 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.SCALE_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,0,27,5)(SDO_GTYPE, SDO_SRI -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 5, 2, 4, 7, 8, 4, 13, 12, 4, 17, 12, 10, 23, 8, 10, 27, 5, 14, 32)) -- Reverse direction (for example, to concatenate with another road) SELECT SDO_LRS.SCALE_GEOM_SEGMENT(a.route_geometry, m.diminfo,27, 0, 0) 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.SCALE_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,27,0,0)(SDO_GTYPE, SDO_SRI -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 5, 14, 0, 8, 10, 5, 12, 10, 9, 12, 4, 15, 8, 4, 19, 2, 4, 25, 2, 2, 27)) -- "Convert" mile measures to kilometers (27 * 1.609 = 43.443) SELECT SDO_LRS.SCALE_GEOM_SEGMENT(a.route_geometry, m.diminfo, 0, 43.443, 0) 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.SCALE_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,0,43.443,0)(SDO_GTYPE, SDO -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, 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))
SDO_LRS.SPLIT_GEOM_SEGMENT(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
split_measure IN NUMBER,
geom_segment_1 OUT MDSYS.SDO_GEOMETRY,
geom_segment_2 OUT MDSYS.SDO_GEOMETRY);
Splits a geometric segment into two geometric segments. (This is a procedure, not a function.)
Geometric segment to be split.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance measured from the start point of a geometric segment to the split point.
First geometric segment: from the start point of geom_segment to the split point.
Second geometric segment: from the split point to the end point of geom_segment.
An exception is raised if geom_segment or split_measure is invalid.
The directions and measures of the resulting geometric segments are preserved.
For more information about splitting a geometric segment, see Section E.4.4.
The following example defines the geometric segment, splits it into two segments, then concatenates those segments. (This example uses the definitions from the example in Section E.5. The definitions of result_geom_1, result_geom_2, and result_geom_3 are displayed in Example E-3.)
DECLARE geom_segment MDSYS.SDO_GEOMETRY; line_string MDSYS.SDO_GEOMETRY; dim_array MDSYS.SDO_DIM_ARRAY; result_geom_1 MDSYS.SDO_GEOMETRY; result_geom_2 MDSYS.SDO_GEOMETRY; result_geom_3 MDSYS.SDO_GEOMETRY; 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'; -- Define the LRS segment for Route1. SDO_LRS.DEFINE_GEOM_SEGMENT (geom_segment, dim_array, 0, -- Zero starting measure: LRS segment starts at start of route. 27); -- End of LRS segment is at measure 27. SELECT a.route_geometry INTO line_string FROM lrs_routes a WHERE a.route_name = 'Route1'; -- Split Route1 into two segments. SDO_LRS.SPLIT_GEOM_SEGMENT(line_string,dim_array,5,result_geom_1,result_geom_2); -- Concatenate the segments that were just split. result_geom_3 := SDO_LRS.CONCATENATE_GEOM_SEGMENTS(result_geom_1, dim_array, result_geom_2, dim_array); -- Insert geometries into table, to display later. INSERT INTO lrs_routes VALUES( 11, 'result_geom_1', result_geom_1 ); INSERT INTO lrs_routes VALUES( 12, 'result_geom_2', result_geom_2 ); INSERT INTO lrs_routes VALUES( 13, 'result_geom_3', result_geom_3 ); END; /
SDO_LRS.TRANSLATE_MEASURE(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
translate_m IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY;
Returns a new geometric segment by translating the original geometric segment (that is, shifting the start and end measures by a specified value).
Cartographic representation of a linear feature.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Distance measured from the start point of a geometric segment to the start point of the linear feature.
This function adds translate_m to the start and end measures of geom_segment. For example, if geom_segment has a start measure of 50 and an end measure of 100, and if translate_m is 10, the returned geometric segment has a start measure of 60 and an end measure of 110, as shown in Figure 9-2.
An exception is raised if geom_segment is invalid.
The following example translates (shifts) by 10 the geometric segment representing Route 1. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.TRANSLATE_MEASURE(a.route_geometry, m.diminfo, 10) 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.TRANSLATE_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,10)(SDO_GTYPE, SDO_SRID, SD -------------------------------------------------------------------------------- SDO_GEOMETRY(3002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 2, 2, 10, 2, 4, 12, 8, 4, 18, 12, 4, 22, 12, 10, 28, 8, 10, 32, 5, 14, 37))
SDO_LRS.VALID_GEOM_SEGMENT(
Checks if a geometry object is a valid geometric segment.
Geometric segment to be checked for validity.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns TRUE if geom_segment is valid and FALSE if geom_segment is not valid.
Measure information is assumed to be stored in the last element of the SDO_DIM_ARRAY in the Oracle Spatial metadata.
This function only checks for geometry type and number of dimensions of the geometric segment. To further validate measure information, use the IS_GEOM_SEGMENT_DEFINED function.
The following example checks if the geometric segment representing Route 1 is valid. (This example uses the definitions from the example in Section E.5.)
SELECT SDO_LRS.VALID_GEOM_SEGMENT(a.route_geometry, m.diminfo) 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.VALID_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO) -------------------------------------------------------------------------------- TRUE
SDO_LRS.VALID_LRS_PT(
Checks if an LRS point is valid.
Point to be checked for validity.
Dimensional information array corresponding to point, usually selected from one of the xxx_SDO_GEOM_METADATA views.
This function returns TRUE if point is valid and FALSE if point is not valid.
This function checks if point is a point with measure information, and it checks for the geometry type and number of dimensions for the point geometry.
Ordinate information needs to be stored in SDO_ELEM_INFO_ARRAY and SDO_ORDINATE_ARRAY. The SDO_POINT field in the SDO_GEOMETRY definition of the point should not be used for LRS points, because SDO_POINT supports the definition of only three attributes (X, Y, Z).
The following example checks if point (9,3,NULL) is a valid LRS point.
SELECT SDO_LRS.VALID_LRS_PT( MDSYS.SDO_GEOMETRY(3001, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1, 1), MDSYS.SDO_ORDINATE_ARRAY(9, 3, NULL)), m.diminfo) 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.VALID_LRS_PT(MDSYS.SDO_GEOMETRY(3001,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY -------------------------------------------------------------------------------- TRUE
SDO_LRS.VALID_MEASURE(
geom_segment IN MDSYS.SDO_GEOMETRY,
dim_array IN MDSYS.SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN VARCHAR2;
Checks if a measure falls within the measure range of a geometric segment.
Geometric segment to be checked to see if it falls within the measure range of measure.
Dimensional information array corresponding to geom_segment, usually selected from one of the xxx_SDO_GEOM_METADATA views.
Geometric segment to be checked to see if geom_segment falls within its measure range.
This function returns TRUE if measure falls within the measure range of geom_segment and FALSE if measure does not fall within the measure range of geom_segment.
An exception is raised if geom_segment is invalid.
The following example checks if 50 is a valid measure on the Route 1 segment. The function returns FALSE because the measure range for that segment is 0 to 27. (For example, if the route is 27 miles long and there is a mile marker at one-mile intervals, there is no 50-mile marker because the last marker is the 27-mile marker.)
SELECT SDO_LRS.VALID_MEASURE(a.route_geometry, m.diminfo, 50) 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.VALID_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,50) -------------------------------------------------------------------------------- FALSE
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|