3*P@ rZdP>Є.a@m43%EbD)ʔBC3t15b h!n`t+k\FiɃ
'C*ja( a 0X,B L@hx@wZF~4
x0"U L (<zJA0u~0/K>, $x_w={1_DE
(hD lA
Ն^A@* @MA
ǄE
@@`F!b0!A(e`\ŀԠo@9D@z!
B@HF aZqlA%
a2!`9R$@Gy߱+qSܺy@܂R؊!2HuS_*̞oVU>+"APr0GswF !%KG0@8!hMͧC(9@)6PAͅА
FH9$LԀ`y`L/B
ЂhLDr!t,<(iZ8FKtPDR, M(P@ Nl"6DQHDBH>H08
xk;h(DEr3ꮼ$0"%K6PőfJcVbEU[k,l'7G,Wlg#/@9b$,q),846aAԀE(sD4)2P@0T$1^RpiQIЊك>Ta3hY(UtQ5Oᝄ YY'WR$ A
fKeUW
~>dN: U_p`vIn
*cr [@T60@09e^@Q`._U
0etW0T>C/H[B8`Bb6;Envs :ZKXĊ <'x9BЂ@!B6\ 19AG?UЄPϊ@%K"aH*kJ&쀆 Ѡ0fM" Q(
!0D@,\K`(IJ@ho>JJX Mhc418aiD/r thAEP%2PB
`B,Dm`RT#zJqꅩ"t C.@)XA)(r@`e%6 kZD
y 8(dp# JN1H
GE`E2QQ\OIls
$'+0 /PpU`$BS4. 10
t8@ hn'sH`\JS
KV@j* aO{kY<`DAUB#ˌYX\7,nJZ,+"Vu
.Lx`(@m#SBom/(PҢ~\A1UN2~MqK'4ӛنQBY0:"FBԔ%GB4'lX{B,D>*@X"lt~OMr}DBA10(SpS엿ڴK<30yLdES9x8z($ؘ=}P@n&f_XfH] @ŌcR7y"*{5 hHjHbsc
h/= _tQdϻ
S(="!t"vATn
>i6?@@_0 Ӹ04hԎ@ jX.4"
^DfJYPC0]E Caz id8{6`PPX}f1~_`6?pd
H8Q)ƛxLۋ0G600Tix@%/PV_50pC `gsK8 a\D=0Eq#DMfz4kX8 `U?[b@z%Myz;:`3T6FWMchp{wRywR?@RPxY;PEp?0Z@clPk
!lp0VA#ΠA./sƷEh10mDt']3V
{0o"֎ʀEč F"3_'2Pmt3qf vb&bh" 3oV@:y.}7h3y"G(I*5v /O)+ x(+9Ɏ]
2q5pBb1Q%Ep wI`=u5vm" U9uguAVH^ &m !\{P)fN!@%Mz$ɐ r4Q0K8G&pU68'vpАnW&$p1 2cMKx9C0U7
`x`2iy9X.$8+B {{p2(
Jc@1R
g1C!t4vQ`5FB4V0qP*wOmBp%KY$Q9@}ar &LS? LHv524p=P$tX"/Vrt!hrQ["霈@xwZ0T@4 a2㵛
:)]7C
ȨJ0/P@X@C0HP`4@SŞ0ѪУhz
&B9_M//P;`8@7G0Y
W%A@PjP4 )䇒q
㔀"n)`
cˎmzI*rr J% {3ZS˵fE9O;zQjWI1NU[yK+ =dgj?Ep/<{)pжM n!t[1pP9 ӨSx R4w$g>,k\Sϰj "o#!ɸ0YkA0/!j !Ky{8]+mj<ٓ@:Z؛{[{OJJ;sK+{/Y a%
e2oɱp;Ka&1ȢKK@G@b`btL<OvL٨3xFL W_5.g1F2B \aP\q+$;~[4Q@ȗ}P0O]3+'ԂSvEhO
x\$كƧE k5iI8R<[8.ʃްh`Eߌ״ {pePXZ \3z10k ?4m0++#3OmoK@pB &M/܌E[4Z1IrZO +ZRr؟O1
R;Pɩ̸ۭ҄
۽a*\Cas1H"t3j$qǏ:I2Ȓ(S>;يxΡX)%+
8x&n&䓧S`MU]` (A:!!
Áx,`*/j!*8 iEMEB t%$hF+8y$E$N%4#B%S! *
pZ@
xMB6n&3aѝE:<
A/NqUZ!A DyvX !
Z@N`DC^}uA (!APD( a`\3vNSb^s
Tâ ^I0Ey$;!`$ 0QH:~
,j= hEy_
JsB
Єt\(0Qt&&p(h@Xp@F(".,GLjk!eWꫭpk&lJPYLP $B"C̄\dkε,}PP m"T$F@자ITNb! @i@Kblp}KƩ.K8{Q9xCTĨ̲ rA8 #ձ ,(s
16^tt
gST=3nӄ]K@,L
Pqa PwM)
ypN#9ww8hx9 9Ta'ܢ}Q4bmGD\QP #0B6=}MD @h~:CTNͧۄ K:^PPo! s7
Preface
Preface
Oracle Spatial User's Guide and Reference provides usage and reference information for indexing and storing spatial data and for developing spatial applications using Oracle Spatial and Oracle Locator.
Oracle Spatial requires the Enterprise Edition of Oracle Database 10g. It is a foundation for the deployment of enterprisewide spatial information systems, and Webbased and wireless locationbased applications requiring complex spatial data management. Oracle Locator is a feature of the Standard and Enterprise Editions of Oracle Database 10g. It offers a subset of Oracle Spatial capabilities (see Appendix B for a list of Locator features) typically required to support Internet and wireless service applications and partnerbased geographic information system (GIS) solutions.
The Standard and Enterprise Editions of Oracle Database 10g have the same basic features. However, several advanced features, such as extended data types, are available only with the Enterprise Edition, and some of these features are optional. For example, to use Oracle Database 10g table partitioning, you must have the Enterprise Edition and the Partitioning Option.
For information about the differences between Oracle Database 10g Standard Edition and Oracle Database 10g Enterprise Edition and the features and options that are available to you, see Oracle Database New Features.
Note:
The relational geometry model of Oracle Spatial is no longer supported, effective with Oracle release 9.2. Only the objectrelational model is supported. 
Audience
This guide is intended for anyone who needs to store spatial data in an Oracle database.
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community. Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other marketleading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers. For more information, visit the Oracle Accessibility Program Web site at
http://www.oracle.com/accessibility/
Accessibility of Code Examples in Documentation
Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.
Accessibility of Links to External Web Sites in Documentation
This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.
TTY Access to Oracle Support Services
Oracle provides dedicated Text Telephone (TTY) access to Oracle Support Services within the United States of America 24 hours a day, seven days a week. For TTY support, call 800.446.2398.
Related Documents
For more information, see the following documents:
Oracle error message documentation is only available in HTML. If you only have access to the Oracle Documentation CD, you can browse the error messages by range. Once you find the specific range, use your browser's "find in page" feature to locate the specific message. When connected to the Internet, you can search for a specific error message using the error message search feature of the Oracle online documentation.
Printed documentation is available for sale in the Oracle Store at
http://oraclestore.oracle.com/
To download free release notes, installation documentation, white papers, or other collateral, go to the Oracle Technology Network (OTN). You must register online before using OTN; registration is free and can be done at
http://www.oracle.com/technology/membership
If you already have a user name and password for OTN, then you can go directly to the documentation section of the OTN Web site at
http://www.oracle.com/technology/documentation
Conventions
The following text conventions are used in this document:
PKث](X(PKMFOEBPS/sdoxor.gifGIF89a~~~333WWW???rrrfffKKK$$$,` dihlp
tmxpH,Ȥrl:tJ~ϬvzQxl~:&8zNg[nxzek=Mql:c1,~T"p_ĉnh[͖D6ׇUWBS;,b<F1De*ZHLƍ{ 2<$Kt&ʕ¸ S4kbb4>sĳNW21R@X$`@X"@X xǒ?E?%` k$p
j @YY,O~B")_lFdqn(HũՀ] Kץ]۬sVd`,Xogtf5_)x
Ax`/pݽNï0KիYmsbeZģ~\uݕ^}`
'?msd
1e!YUNɒjXDjHݐ?@Z</dm<[__m8
,Kn9VtD
g 7viG:<bلIp.x块ʝ! \yǗjh~4E(PKD:ϥfziq2SQ2䦏J4j6#zj6ZϪ:ͮŊЬ(
{(J$9*j)x+,Z;+ +(
<0"ٛ((L'9l)PI,Y+)1ivzݚ<.kS3F0ts9"3,AsG=GoE;M{;$gP@\\赞 }[lqp'wt;JOl%@4y67~oI%>.'Bމ#`N4r^y箁H>Յ~]۫?ݺv>KSbý3/2rr={<61鋱~>'2ᗢ?B;PKsD PKMFOEBPS/sdo_lrs_ref.htm
SDO_LRS Package (Linear Referencing System)
16 SDO_LRS Package (Linear Referencing System)
The MDSYS.SDO_LRS package contains subprograms that create, modify, query, and convert linear referencing elements. These subprograms do not change the state of the database. Most LRS subprograms are functions.
To use the subprograms in this chapter, you must understand the linear referencing system (LRS) concepts and techniques described in Chapter 7.
Table 161 lists subprograms related to creating and editing geometric segments.
Table 162 lists subprograms related to querying geometric segments.
Table 163 lists subprograms related to converting geometric segments.
For more information about conversion subprograms, see Section 7.5.10.
The rest of this chapter provides reference information on the subprograms, listed in alphabetical order.
SDO_LRS.CLIP_GEOM_SEGMENT
Format
SDO_LRS.CLIP_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
start_measure IN NUMBER,
end_measure IN NUMBER,
tolerance IN NUMBER DEFAULT 1.0e8
) RETURN SDO_GEOMETRY;
or
SDO_LRS.CLIP_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER
) RETURN SDO_GEOMETRY;
Description
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. 
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 start_measure

Start measure of the geometric segment.
 end_measure

End measure of the geometric segment.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
An exception is raised if geom_segment
, start_measure
, or end_measure
is invalid.
start_measure
and end_measure
can be any points on the geometric segment. They do not have to be in any specific order. For example, start_measure
and end_measure
can be 5 and 10, respectively, or 10 and 5, respectively.
The direction and measures of the resulting geometric segment are preserved (that is, they reflect the original segment).
The _3D format of this function (SDO_LRS.CLIP_GEOM_SEGMENT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about clipping geometric segments, see Section 7.5.3.
Examples
The following example clips the geometric segment representing Route 1, returning the segment from measures 5 through 10. This segment might represent a construction zone. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.CLIP_GEOM_SEGMENT(route_geometry, 5, 10)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.CLIP_GEOM_SEGMENT(ROUTE_GEOMETRY,5,10)(SDO_GTYPE, SDO_SRID, SDO_POINT(X,

SDO_GEOMETRY(3302, 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
Format
SDO_LRS.CONCATENATE_GEOM_SEGMENTS(
geom_segment_1 IN SDO_GEOMETRY,
geom_segment_2 IN SDO_GEOMETRY,
tolerance IN NUMBER DEFAULT 1.0e8
) RETURN SDO_GEOMETRY;
or
SDO_LRS.CONCATENATE_GEOM_SEGMENTS(
geom_segment_1 IN SDO_GEOMETRY,
dim_array_1 IN SDO_DIM_ARRAY,
geom_segment_2 IN SDO_GEOMETRY,
dim_array_2 IN SDO_DIM_ARRAY
) RETURN SDO_GEOMETRY;
Description
Returns the geometry object resulting from the concatenation of two geometric segments.
Parameters
 geom_segment_1

First geometric segment to be concatenated.
 dim_array_1

Dimensional information array corresponding to geom_segment_1
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 geom_segment_2

Second geometric segment to be concatenated.
 dim_array_2

Dimensional information array corresponding to geom_segment_2
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
An exception is raised if geom_segment_1
or geom_segment_2
has an invalid geometry type or dimensionality, or if geom_segment_1
and geom_segment_2
are based on different coordinate systems.
The direction of the first 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.
The geometry type of geom_segment_1
and geom_segment_2
must be line or multiline. Neither can be a polygon.
The _3D format of this function (SDO_LRS.CONCATENATE_GEOM_SEGMENTS_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about concatenating geometric segments, see Section 7.5.5.
Examples
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 7.7. The definitions of result_geom_1
, result_geom_2
, and result_geom_3
are displayed in Example 73.)
DECLARE
geom_segment SDO_GEOMETRY;
line_string SDO_GEOMETRY;
dim_array SDO_DIM_ARRAY;
result_geom_1 SDO_GEOMETRY;
result_geom_2 SDO_GEOMETRY;
result_geom_3 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
Format
SDO_LRS.CONNECTED_GEOM_SEGMENTS(
geom_segment_1 IN SDO_GEOMETRY,
geom_segment_2 IN SDO_GEOMETRY,
tolerance IN NUMBER DEFAULT 1.0e8
) RETURN VARCHAR2;
or
SDO_LRS.CONNECTED_GEOM_SEGMENTS(
geom_segment_1 IN SDO_GEOMETRY,
dim_array_1 IN SDO_DIM_ARRAY,
geom_segment_2 IN SDO_GEOMETRY,
dim_array_2 IN SDO_DIM_ARRAY
) RETURN VARCHAR2;
Description
Checks if two geometric segments are spatially connected.
Parameters
 geom_segment_1

First of two geometric segments to be checked.
 dim_array_1

Dimensional information array corresponding to geom_segment_1
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 geom_segment_2

Second of two geometric segments to be checked.
 dim_array_2

Dimensional information array corresponding to geom_segment_2
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
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
has an invalid geometry type or dimensionality, or if geom_segment_1
and geom_segment_2
are based on different coordinate systems.
The _3D format of this function (SDO_LRS.CONNECTED_GEOM_SEGMENTS_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
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,
b.route_geometry, 0.005)
FROM lrs_routes a, lrs_routes b
WHERE a.route_id = 11 AND b.route_id = 12;
SDO_LRS.CONNECTED_GEOM_SEGMENTS(A.ROUTE_GEOMETRY,B.ROUTE_GEOMETRY,0.005)

TRUE
SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY
Format
SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(
dim_array IN SDO_DIM_ARRAY
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN SDO_DIM_ARRAY;
or
SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(
dim_array IN SDO_DIM_ARRAY,
dim_name IN VARCHAR2
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN SDO_DIM_ARRAY;
or
SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY(
dim_array IN SDO_DIM_ARRAY,
dim_name IN VARCHAR2,
dim_pos IN INTEGER
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN SDO_DIM_ARRAY;
Description
Converts a standard dimensional array to an LRS dimensional array by creating a measure dimension.
Parameters
 dim_array

Dimensional information array corresponding to the layer (column of geometries) to be converted, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 dim_name

Name of the measure dimension (M
, if not otherwise specified).
 dim_pos

Position of the measure dimension (the last SDO_DIM_ELEMENT object position in the SDO_DIM_ARRAY, if not otherwise specified).
 lower_bound

Lower bound (SDO_LB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
 upper_bound

Upper bound (SDO_UB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
This function converts a standard dimensional array to an LRS 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 dimensional array (unless another dim_pos
is specified), and sets the SDO_DIMNAME value in this added SDO_DIM_ELEMENT to M (unless another dim_name
is specified). It sets the other values in the added SDO_DIM_ELEMENT according to the values of the upper_bound
, lower_bound
, and tolerance
parameter values.
If dim_array
already contains dimensional information, the dim_array
is returned.
The _3D format of this function (SDO_LRS.CONVERT_TO_LRS_DIM_ARRAY_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
The following example converts the dimensional array for the LRS_ROUTES table to LRS format. (This example uses the definitions from the example in Section 7.7.)
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
Format
SDO_LRS.CONVERT_TO_LRS_GEOM(
standard_geom IN SDO_GEOMETRY
[, start_measure IN NUMBER,
end_measure IN NUMBER]
) RETURN SDO_GEOMETRY;
or
SDO_LRS.CONVERT_TO_LRS_GEOM(
standard_geom IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY
[, start_measure IN NUMBER,
end_measure IN NUMBER]
) RETURN SDO_GEOMETRY;
or
SDO_LRS.CONVERT_TO_LRS_GEOM(
standard_geom IN SDO_GEOMETRY,
m_pos IN INTEGER
[, start_measure IN NUMBER,
end_measure IN NUMBER]
) RETURN SDO_GEOMETRY;
Description
Converts a standard SDO_GEOMETRY line string to an LRS geometric segment by adding measure information.
Parameters
 standard_geom

Line string geometry that does not contain measure information.
 dim_array

Dimensional information array corresponding to standard_geom
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 m_pos

Position of the measure dimension. If specified, must be 3 or 4. By default, the measure dimension is the last dimension in the SDO_DIM_ARRAY.
 start_measure

Distance measured from the start point of a geometric segment to the start point of the linear feature. 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 cartographic length (for example, 75 if the cartographic length is 75 and the unit of measure is miles).
Usage Notes
This function returns an LRS geometric segment with measure information, with measure information provided for all shape points.
An exception is raised if standard_geom
has an invalid geometry type or dimensionality, if m_pos
is less than 3 or greater than 4, or if start_measure
or end_measure
is out of range.
The _3D format of this function (SDO_LRS.CONVERT_TO_LRS_GEOM_3D) is available; however, the m_pos
parameter is not available for SDO_LRS.CONVERT_TO_LRS_GEOM_3D. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
The following example converts the geometric segment representing Route 1 to LRS format. (This example uses the definitions from the example in Section 7.7.)
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
Format
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;
or
SDO_LRS.CONVERT_TO_LRS_LAYER(
table_name IN VARCHAR2,
column_name IN VARCHAR2,
dim_name IN VARCHAR2,
dim_pos IN INTEGER
[, lower_bound IN NUMBER,
upper_bound IN NUMBER,
tolerance IN NUMBER]
) RETURN VARCHAR2;
Description
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 LRS geometric segments with measure information, and updates the metadata in the USER_SDO_GEOM_METADATA view.
Parameters
 table_name

Table containing the column with the SDO_GEOMETRY objects.
 column_name

Column in table_name
containing the SDO_GEOMETRY objects.
 dim_name

Name of the measure dimension. If this parameter is null, M
is assumed.
 dim_pos

Position of the measure dimension within the SDO_DIM_ARRAY structure for the specified SDO_GEOMETRY column. If this parameter is null, the number corresponding to the last position is assumed.
 lower_bound

Lower bound (SDO_LB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
 upper_bound

Upper bound (SDO_UB value in the SDO_DIM_ELEMENT definition) of the ordinate in the measure dimension.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
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.
If a spatial index already exists on column_name
, you must delete (drop) the index before converting the layer and create a new index after converting the layer. For information about deleting and creating indexes, see the DROP INDEX and CREATE INDEX statements in Chapter 10.
The _3D format of this function (SDO_LRS.CONVERT_TO_LRS_LAYER_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
The following example converts the geometric segments in the ROUTE_GEOMETRY column of the LRS_ROUTES table to LRS format. (This example uses the definitions from the example in Section 7.7.) The SELECT statement shows that dimensional information has been added (that is, SDO_DIM_ELEMENT('M', NULL, NULL, NULL)
is 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
Format
SDO_LRS.CONVERT_TO_STD_DIM_ARRAY(
dim_array IN SDO_DIM_ARRAY
[, m_pos IN INTEGER]
) RETURN SDO_DIM_ARRAY;
Description
Converts an LRS dimensional array to a standard dimensional array by removing the measure dimension.
Parameters
 dim_array

Dimensional information array corresponding to the layer (column of geometries) to be converted, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 m_pos

Position of the measure dimension. If specified, must be 3 or 4. By default, the measure dimension is the last dimension in the SDO_DIM_ARRAY.
Usage Notes
This function converts an LRS 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 dim_array
.
An exception is raised if m_pos
is invalid (less than 3 or greater than 4).
If dim_array
is already a standard dimensional array (that is, does not contain dimensional information), the dim_array
is returned.
The _3D format of this function (SDO_LRS.CONVERT_TO_STD_DIM_ARRAY_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
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 7.7.)
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
Format
SDO_LRS.CONVERT_TO_STD_GEOM(
lrs _geom IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
Description
Converts an LRS geometric segment to a standard SDO_GEOMETRY line string by removing measure information.
Parameters
 lrs_geom

LRS geometry that contains measure information.
 dim_array

Dimensional information array corresponding to lrs_geom
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns an SDO_GEOMETRY object in which all measure information is removed.
The _3D format of this function (SDO_LRS.CONVERT_TO_STD_GEOM_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
The following example converts the geometric segment representing Route 1 to standard format. (This example uses the definitions from the example in Section 7.7.)
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
Format
SDO_LRS.CONVERT_TO_STD_LAYER(
table_name IN VARCHAR2,
column_name IN VARCHAR2
) RETURN VARCHAR2;
Description
Converts all geometry objects in a column of type SDO_GEOMETRY (that is, converts a layer) from LRS geometric segments with measure information to standard line string geometries without measure information, and updates the metadata in the USER_SDO_GEOM_METADATA view.
Parameters
 table_name

Table containing the column with the SDO_GEOMETRY objects.
 column_name

Column in table_name
containing the SDO_GEOMETRY objects.
Usage Notes
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.
If a spatial index already exists on column_name
, you must delete (drop) the index before converting the layer and create a new index after converting the layer. For information about deleting and creating indexes, see the DROP INDEX and CREATE INDEX statements in Chapter 10.
The _3D format of this function (SDO_LRS.CONVERT_TO_STD_LAYER_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about conversion functions, see Section 7.5.10.
Examples
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 7.7.) The SELECT statement shows that dimensional information has been removed (that is, no SDO_DIM_ELEMENT('M', NULL, NULL, NULL)
is 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
Format
SDO_LRS.DEFINE_GEOM_SEGMENT(
geom_segment IN OUT SDO_GEOMETRY
[, start_measure IN NUMBER,
end_measure IN NUMBER]);
or
SDO_LRS.DEFINE_GEOM_SEGMENT(
geom_segment IN OUT SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY
[, start_measure IN NUMBER,
end_measure IN NUMBER]);
Description
Defines a geometric segment by assigning start and end measures to a geometric segment, and assigns values to any null measures.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 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.
All unassigned measures of the geometric segment will be populated automatically.
To store the resulting geometric segment (geom_segment
) in the database, you must execute an UPDATE or INSERT statement, as appropriate.
The _3D format of this procedure (SDO_LRS.DEFINE_GEOM_SEGMENT_3D) is available. For information about _3D formats of LRS functions and procedures, see Section 7.4.
For more information about defining a geometric segment, see Section 7.5.1.
Examples
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 7.7. The definitions of result_geom_1
, result_geom_2
, and result_geom_3
are displayed in Example 73.)
DECLARE
geom_segment SDO_GEOMETRY;
line_string SDO_GEOMETRY;
dim_array SDO_DIM_ARRAY;
result_geom_1 SDO_GEOMETRY;
result_geom_2 SDO_GEOMETRY;
result_geom_3 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. This will populate any null measures.
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);
 Update and insert geometries into table, to display later.
UPDATE lrs_routes a SET a.route_geometry = geom_segment
WHERE a.route_id = 1;
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
Format
SDO_LRS.DYNAMIC_SEGMENT(
geom_segment IN SDO_GEOMETRY,
start_measure IN NUMBER,
end_measure IN NUMBER,
tolerance IN NUMBER DEFAULT 1.0e8
) RETURN SDO_GEOMETRY;
or
SDO_LRS.DYNAMIC_SEGMENT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER
) RETURN SDO_GEOMETRY;
Description
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. 
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 start_measure

Start measure of the geometric segment.
 end_measure

End measure of the geometric segment.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
Usage Notes
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 7.5.3.
Examples
The following example clips the geometric segment representing Route 1, returning the segment from measures 5 through 10. This segment might represent a construction zone. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.DYNAMIC_SEGMENT(route_geometry, 5, 10)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.DYNAMIC_SEGMENT(ROUTE_GEOMETRY,5,10)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y

SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
5, 4, 5, 8, 4, 8, 10, 4, 10))
SDO_LRS.FIND_LRS_DIM_POS
Format
SDO_LRS.FIND_LRS_DIM_POS(
table_name IN VARCHAR2,
column_name IN VARCHAR2
) RETURN INTEGER;
Description
Returns the position of the measure dimension within the SDO_DIM_ARRAY structure for a specified SDO_GEOMETRY column.
Parameters
 table_name

Table containing the column with the SDO_GEOMETRY objects.
 column_name

Column in table_name
containing the SDO_GEOMETRY objects.
Usage Notes
None.
Examples
The following example returns the position of the measure dimension within the SDO_DIM_ARRAY structure for geometries in the ROUTE_GEOMETRY column of the LRS_ROUTES table. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.FIND_LRS_DIM_POS('LRS_ROUTES', 'ROUTE_GEOMETRY') FROM DUAL;
SDO_LRS.FIND_LRS_DIM_POS('LRS_ROUTES','ROUTE_GEOMETRY')

3
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

Cartographic representation of a linear feature. This function returns the measure of the point on this segment that is closest to the projection point.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 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 Section 7.4.
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 Section 7.7.)
 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
SDO_LRS.FIND_OFFSET
Format
SDO_LRS.FIND_OFFSET(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY,
tolerance IN NUMBER DEFAULT 1.0e8
) RETURN NUMBER;
or
SDO_LRS.FIND_OFFSET(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
[, point_dim_array IN SDO_GEOMETRY]
) RETURN NUMBER;
Description
Returns the signed offset (shortest distance) from a point to a geometric segment.
Parameters
 geom_segment

Geometric segment to be checked for distance from point
.
 point

Point whose shortest distance from geom_segment
is to be returned.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 point_dim_array

Dimensional information array corresponding to point
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function calls the SDO_LRS.PROJECT_PT function format that includes the offset
output parameter: it passes in the geometric segment and point information, and it returns the SDO_LRS.PROJECT_PT offset
parameter value. Thus, to find the offset of a point from a geometric segment, you can use either this function or the SDO_LRS.PROJECT_PT function with the offset
parameter.
An exception is raised if geom_segment
or point
has an invalid geometry type or dimensionality, or if geom_segment
and point
are based on different coordinate systems.
For more information about offsets to a geometric segment, see Section 7.1.5.
Examples
The following example returns the offset of point (9,3,NULL) from the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.) As you can see from Figure 720 in Section 7.7, the point at (9,3,NULL) is on the right side along the segment, and therefore the offset has a negative value, as explained in Section 7.1.5. The point at (9,3.NULL) is one distance unit away from the point at (9,4,NULL), which is on the segment.
 Find the offset of point (9,3,NULL) from the road; should return 1.
SELECT SDO_LRS.FIND_OFFSET(route_geometry,
SDO_GEOMETRY(3301, NULL, NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
SDO_ORDINATE_ARRAY(9, 3, NULL)) )
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.FIND_OFFSET(ROUTE_GEOMETRY,SDO_GEOMETRY(3301,NULL,NULL,SDO_ELEM_INFO_ARR

1
SDO_LRS.GEOM_SEGMENT_END_MEASURE
Format
SDO_LRS.GEOM_SEGMENT_END_MEASURE(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN NUMBER;
Description
Returns the end measure of a geometric segment.
Parameters
 geom_segment

Geometric segment whose end measure is to be returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns the end measure of geom_segment
.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.GEOM_SEGMENT_END_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the end measure of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GEOM_SEGMENT_END_MEASURE(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.GEOM_SEGMENT_END_MEASURE(ROUTE_GEOMETRY)

27
SDO_LRS.GEOM_SEGMENT_END_PT
Format
SDO_LRS.GEOM_SEGMENT_END_PT(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
Description
Returns the end point of a geometric segment.
Parameters
 geom_segment

Geometric segment whose end point is to be returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns the end point of geom_segment
.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.GEOM_SEGMENT_END_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the end point of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GEOM_SEGMENT_END_PT(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.GEOM_SEGMENT_END_PT(ROUTE_GEOMETRY)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y,

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
5, 14, 27))
SDO_LRS.GEOM_SEGMENT_LENGTH
Format
SDO_LRS.GEOM_SEGMENT_LENGTH(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN NUMBER;
Description
Returns the length of a geometric segment.
Parameters
 geom_segment

Geometric segment whose length is to be calculated.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
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.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.GEOM_SEGMENT_LENGTH_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the length of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GEOM_SEGMENT_LENGTH(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.GEOM_SEGMENT_LENGTH(ROUTE_GEOMETRY)

27
SDO_LRS.GEOM_SEGMENT_START_MEASURE
Format
SDO_LRS.GEOM_SEGMENT_START_MEASURE(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN NUMBER;
Description
Returns the start measure of a geometric segment.
Parameters
 geom_segment

Geometric segment whose start measure is to be returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns the start measure of geom_segment
.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.GEOM_SEGMENT_START_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the start measure of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GEOM_SEGMENT_START_MEASURE(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.GEOM_SEGMENT_START_MEASURE(ROUTE_GEOMETRY)

0
SDO_LRS.GEOM_SEGMENT_START_PT
Format
SDO_LRS.GEOM_SEGMENT_START_PT(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
Description
Returns the start point of a geometric segment.
Parameters
 geom_segment

Geometric segment whose start point is to be returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns the start point of geom_segment
.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.GEOM_SEGMENT_START_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the start point of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GEOM_SEGMENT_START_PT(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.GEOM_SEGMENT_START_PT(ROUTE_GEOMETRY)(SDO_GTYPE, SDO_SRID, SDO_POINT(X,

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
2, 2, 0))
SDO_LRS.GET_MEASURE
Format
SDO_LRS.GET_MEASURE(
point IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN NUMBER;
Description
Returns the measure of an LRS point.
Parameters
 point

Point whose measure is to be returned.
 dim_array

Dimensional information array corresponding to point
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns the measure of an LRS point.
If point
is not valid, an "invalid LRS point" 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 opposed to a measure value. 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 _3D format of this function (SDO_LRS.GET_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
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.
SELECT SDO_LRS.GET_MEASURE(
SDO_LRS.PROJECT_PT(a.route_geometry, m.diminfo,
SDO_GEOMETRY(3001, NULL, NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
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,SDO_GEOM

9
SDO_LRS.GET_NEXT_SHAPE_PT
Format
SDO_LRS.GET_NEXT_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_NEXT_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_NEXT_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_NEXT_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
) RETURN SDO_GEOMETRY;
Description
Returns the next shape point on a geometric segment after a specified measure value or LRS point.
Parameters
 geom_segment

Geometric segment.
 measure

Measure value on the geometric segment for which to return the next shape point.
 point

Point for which to return the next shape point. If point
is not on geom_segment
, the point on the geometric segment closest to the specified point is computed, and the next shape point after that point is returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
If measure
or point
identifies the end point of the geometric segment, a null value is returned.
An exception is raised if measure
is not a valid value for geom_segment
or if point
is not a valid LRS point.
Contrast this function with SDO_LRS.GET_PREV_SHAPE_PT, which returns the previous shape point on a geometric segment before a specified measure value or LRS point.
The _3D format of this function (SDO_LRS.GET_NEXT_SHAPE_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the next shape point after measure 14 on the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GET_NEXT_SHAPE_PT(a.route_geometry, 14)
FROM lrs_routes a WHERE a.route_id = 1;
SDO_LRS.GET_NEXT_SHAPE_PT(A.ROUTE_GEOMETRY,14)(SDO_GTYPE, SDO_SRID, SDO_POINT(X,

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
12, 10, 18))
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE
Format
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN NUMBER;
or
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN NUMBER;
or
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY
) RETURN NUMBER;
or
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
) RETURN NUMBER;
Description
Returns the measure value of the next shape point on a geometric segment after a specified measure value or LRS point.
Parameters
 geom_segment

Geometric segment.
 measure

Measure value on the geometric segment for which to return the measure value of the next shape point.
 point

Point for which to return the measure value of the next shape point. If point
is not on geom_segment
, the point on the geometric segment closest to the specified point is computed, and the measure value of the next shape point after that point is returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
If measure
or point
identifies the end point of the geometric segment, a null value is returned.
An exception is raised if measure
is not a valid value for geom_segment
or if point
is not a valid LRS point.
Contrast this function with SDO_LRS.GET_PREV_SHAPE_PT_MEASURE, which returns the measure value of the previous shape point on a geometric segment before a specified measure value or LRS point.
The _3D format of this function (SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the measure value of the next shape point after measure 14 on the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(a.route_geometry, 14)
FROM lrs_routes a WHERE a.route_id = 1;
SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE(A.ROUTE_GEOMETRY,14)

18
SDO_LRS.GET_PREV_SHAPE_PT
Format
SDO_LRS.GET_PREV_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_PREV_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_PREV_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY
) RETURN SDO_GEOMETRY;
or
SDO_LRS.GET_PREV_SHAPE_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
) RETURN SDO_GEOMETRY;
Description
Returns the previous shape point on a geometric segment before a specified measure value or LRS point.
Parameters
 geom_segment

Geometric segment.
 measure

Measure value on the geometric segment for which to return the previous shape point.
 point

Point for which to return the previous shape point. If point
is not on geom_segment
, the point on the geometric segment closest to the specified point is computed, and the closest shape point before that point is returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
If measure
or point
identifies the start point of the geometric segment, a null value is returned.
An exception is raised if measure
is not a valid value for geom_segment
or if point
is not a valid LRS point.
Contrast this function with SDO_LRS.GET_NEXT_SHAPE_PT, which returns the next shape point on a geometric segment after a specified measure value or LRS point.
The _3D format of this function (SDO_LRS.GET_PREV_SHAPE_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the closest shape point to measure 14 and before measure 14 on the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GET_PREV_SHAPE_PT(a.route_geometry, 14)
FROM lrs_routes a WHERE a.route_id = 1;
SDO_LRS.GET_PREV_SHAPE_PT(A.ROUTE_GEOMETRY,14)(SDO_GTYPE, SDO_SRID, SDO_POINT(X,

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
12, 4, 12))
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE
Format
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN NUMBER;
or
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN NUMBER;
or
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY
) RETURN NUMBER;
or
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
) RETURN NUMBER;
Description
Returns the measure value of the previous shape point on a geometric segment before a specified measure value or LRS point.
Parameters
 geom_segment

Geometric segment.
 measure

Measure value on the geometric segment for which to return the measure value of the previous shape point.
 point

Point for which to return the measure value of the previous shape point. If point
is not on geom_segment
, the point on the geometric segment closest to the specified point is computed, and the measure value of the closest shape point before that point is returned.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
If measure
or point
identifies the start point of the geometric segment, a null value is returned.
An exception is raised if measure
is not a valid value for geom_segment
or if point
is not a valid LRS point.
Contrast this function with SDO_LRS.GET_NEXT_SHAPE_PT_MEASURE, which returns the measure value of the next shape point on a geometric segment after a specified measure value or LRS point.
The _3D format of this function (SDO_LRS.GET_PREV_SHAPE_PT_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the measure value of the closest shape point to measure 14 and before measure 14 on the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(a.route_geometry, 14)
FROM lrs_routes a WHERE a.route_id = 1;
SDO_LRS.GET_PREV_SHAPE_PT_MEASURE(A.ROUTE_GEOMETRY,14)

12
SDO_LRS.IS_GEOM_SEGMENT_DEFINED
Format
SDO_LRS.IS_GEOM_SEGMENT_DEFINED(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if an LRS segment is defined correctly.
Parameters
 geom_segment

Geometric segment to be checked.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
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 or descending order along the segment direction.
The _3D format of this function (SDO_LRS.IS_GEOM_SEGMENT_DEFINED_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
See also the SDO_LRS.VALID_GEOM_SEGMENT function.
Examples
The following example checks if the geometric segment representing Route 1 is defined. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.IS_GEOM_SEGMENT_DEFINED(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.IS_GEOM_SEGMENT_DEFINED(ROUTE_GEOMETRY)

TRUE
SDO_LRS.IS_MEASURE_DECREASING
Format
SDO_LRS.IS_MEASURE_DECREASING(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if the measure values along an LRS segment are decreasing (that is, descending in numerical value).
Parameters
 geom_segment

Geometric segment to be checked.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns TRUE if the measure values along an LRS segment are decreasing and FALSE if the measure values along an LRS segment are not decreasing.
The start and end measures of geom_segment
must be defined (cannot be null).
The _3D format of this function (SDO_LRS.IS_MEASURE_DECREASING_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
See also the SDO_LRS.IS_MEASURE_INCREASING function.
Examples
The following example checks if the measure values along the geometric segment representing Route 1 are decreasing. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.IS_MEASURE_DECREASING(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_MEASURE_DECREASING(A.ROUTE_GEOMETRY,M.DIMINFO)

FALSE
SDO_LRS.IS_MEASURE_INCREASING
Format
SDO_LRS.IS_MEASURE_INCREASING(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if the measure values along an LRS segment are increasing (that is, ascending in numerical value).
Parameters
 geom_segment

Geometric segment to be checked.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns TRUE if the measure values along an LRS segment are increasing and FALSE if the measure values along an LRS segment are not increasing.
The start and end measures of geom_segment
must be defined (cannot be null).
The _3D format of this function (SDO_LRS.IS_MEASURE_INCREASING_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
See also the SDO_LRS.IS_MEASURE_DECREASING function.
Examples
The following example checks if the measure values along the geometric segment representing Route 1 are increasing. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.IS_MEASURE_INCREASING(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_MEASURE_INCREASING(A.ROUTE_GEOMETRY,M.DIMINFO)

TRUE
SDO_LRS.IS_SHAPE_PT_MEASURE
Format
SDO_LRS.IS_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN VARCHAR2;
or
SDO_LRS.IS_SHAPE_PT_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN VARCHAR2;
Description
Checks if a specified measure value is associated with a shape point on a geometric segment.
Parameters
 geom_segment

Geometric segment to be checked.
 measure

Measure value on the geometric segment to check if it is a shape point.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns TRUE if the specified measure value is associated with a shape point and FALSE if the measure value is not associated with a shape point.
An exception is raised if measure
is not a valid value for geom_segment
.
The _3D format of this function (SDO_LRS.IS_SHAPE_PT_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example checks if measure 14 on the geometric segment representing Route 1 is a shape point. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.IS_SHAPE_PT_MEASURE(a.route_geometry, 14)
FROM lrs_routes a WHERE a.route_id = 1;
SDO_LRS.IS_SHAPE_PT_MEASURE(A.ROUTE_GEOMETRY,14)

FALSE
SDO_LRS.LOCATE_PT
Format
SDO_LRS.LOCATE_PT(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
[, offset IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.LOCATE_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
[, offset IN NUMBER]
) RETURN SDO_GEOMETRY;
Description
Returns the point located at a specified distance from the start of a geometric segment.
Parameters
 geom_segment

Geometric segment to be checked to see if it falls within the measure range of measure
.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 measure

Distance to measure from the start point of geom_segment
.
 offset

Distance to measure perpendicularly from the point that is located at measure
units from the start point of geom_segment
. The default is 0 (that is, the point is on geom_segment
).
Usage Notes
This function returns the referenced point. For example, on a highway, the point might represent the location of an accident.
The unit of measurement for offset
is the same as for the coordinate system associated with geom_segment
. For geodetic data, the default unit of measurement is meters.
With geodetic data using the WGS 84 coordinate system, this function can be used to return the longitude and latitude coordinates of any point on or offset from the segment.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality, or if the location is out of range.
The _3D format of this function (SDO_LRS.LOCATE_PT_3D) is available; however, the offset
parameter is not available for SDO_LRS.LOCATE_PT_3D. For information about _3D formats of LRS functions, see Section 7.4.
For more information about locating a point on a geometric segment, see Section 7.5.8.
Examples
The following example creates a table for automobile accident data, inserts a record for an accident at the point at measure 9 and on (that is, offset 0) the geometric segment representing Route 1, and displays the data. (The accident table is deliberately oversimplified. This example also uses the route definition from the example in Section 7.7.)
 Create a table for accidents.
CREATE TABLE accidents (
accident_id NUMBER PRIMARY KEY,
route_id NUMBER,
accident_geometry SDO_GEOMETRY);
 Insert an accident record.
DECLARE
geom_segment SDO_GEOMETRY;
BEGIN
SELECT SDO_LRS.LOCATE_PT(a.route_geometry, 9, 0) into geom_segment
FROM lrs_routes a WHERE a.route_name = 'Route1';
INSERT INTO accidents VALUES(1, 1, geom_segment);
END;
/
SELECT * from accidents;
ACCIDENT_ID ROUTE_ID
 
ACCIDENT_GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_OR

1 1
SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
9, 4, 9))
SDO_LRS.LRS_INTERSECTION
Format
SDO_LRS.LRS_INTERSECTION(
geom_1 IN SDO_GEOMETRY,
dim_array_1 IN SDO_DIM_ARRAY,
geom_2 IN SDO_GEOMETRY,
dim_array_2 IN SDO_DIM_ARRAY
) RETURN SDO_GEOMETRY;
or
SDO_LRS.LRS_INTERSECTION(
geom_1 IN SDO_GEOMETRY,
geom_2 IN SDO_GEOMETRY,
tolerance IN NUMBER
) RETURN SDO_GEOMETRY;
Description
Returns an LRS geometry object that is the topological intersection (AND operation) of two geometry objects where one or both are LRS geometries.
Parameters
 geom_1

Geometry object.
 dim_array_1

Dimensional information array corresponding to geom_1
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 geom_2

Geometry object.
 dim_array_2

Dimensional information array corresponding to geom_2
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 tolerance

Tolerance value (see Section 1.5.5).
Usage Notes
Note:
This function is new with Oracle Spatial release 10.2.0.3. 
This function performs essentially the same intersection operation as the SDO_GEOM.SDO_INTERSECTION function (described in Chapter 15), except that SDO_LRS.LRS_INTERSECTION is designed to return a valid LRS geometry (point, line string, or multiline string) where one or both of the geometryrelated input parameters are LRS geometries. (If neither input geometry is an LRS geometry, this function operates the same as the SDO_GEOM.SDO_INTERSECTION function.).
The returned geometry is an LRS line string, multiline string, or point geometry that includes measure dimension information. The measure values reflect those in the first LRS geometry specified as an input parameter.
The first LRS geometry specified as an input parameter must not be a polygon; it must be a line string, multiline string, or point.
If an LRS line string (geometric segment) intersects a line string (LRS or standard), the result is an LRS point; if an LRS line string intersects a polygon, the result is an LRS line string.
If the function format with tolerance
is used, all geometry objects must be defined using 4digit SDO_GTYPE values (explained in Section 2.2.1).
An exception is raised if geom_1
and geom_2
are based on different coordinate systems.
Examples
The following example shows an LRS geometric segment (illustrated in Figure 720 in Section 7.7) intersected by a vertical line from (8,2) to (8,6). The result is an LRS point geometry, in which the measure value (8) reflects the measure for that point (designated as Exit 3 in Figure 720) in the geom_1
geometry. (This example uses the definitions from the example in Section 7.7.)
 Intersection of LRS segment and standard line segment
SELECT SDO_LRS.LRS_INTERSECTION(route_geometry,
SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,2,1),
SDO_ORDINATE_ARRAY(8,2, 8,6)), 0.005)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.LRS_INTERSECTION(ROUTE_GEOMETRY,SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INF

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
8, 4, 8))
The following example shows an LRS geometric segment (illustrated in Figure 720 in Section 7.7) intersected by a vertical line from (12,2) to (12,6). The result is an LRS line string geometry, in which the measure values (12 and 14) reflect measures for points (the first of which is designated as Exit 4 in Figure 720) in the geom_1
geometry. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.LRS_INTERSECTION(route_geometry,
SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,2,1),
SDO_ORDINATE_ARRAY(12,2, 12,6)), 0.005)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.LRS_INTERSECTION(ROUTE_GEOMETRY,SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INF

SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
12, 4, 12, 12, 6, 14))
SDO_LRS.MEASURE_RANGE
Format
SDO_LRS.MEASURE_RANGE(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN NUMBER;
Description
Returns the measure range of a geometric segment, that is, the difference between the start measure and end measure.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function subtracts the start measure of geom_segment
from the end measure of geom_segment
.
The _3D format of this function (SDO_LRS.MEASURE_RANGE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example returns the measure range of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.MEASURE_RANGE(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.MEASURE_RANGE(ROUTE_GEOMETRY)

27
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

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 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 Section 7.7.) 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.OFFSET_GEOM_SEGMENT
Format
SDO_LRS.OFFSET_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
start_measure IN NUMBER,
end_measure IN NUMBER,
offset IN NUMBER,
tolerance IN NUMBER DEFAULT 1.0e8
[, unit IN VARCHAR2]
) RETURN SDO_GEOMETRY;
or
SDO_LRS.OFFSET_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
start_measure IN NUMBER,
end_measure IN NUMBER,
offset IN NUMBER
[, unit IN VARCHAR2]
) RETURN SDO_GEOMETRY;
Description
Returns the geometric segment at a specified offset from a geometric segment.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 start_measure

Start measure of geom_segment
at which to start the offset operation.
 end_measure

End measure of geom_segment
at which to start the offset operation.
 offset

Distance to measure perpendicularly from the points along geom_segment
. Positive offset values are to the left of geom_segment
; negative offset values are to the right of geom_segment
.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
 unit

Unit of measurement specification: a quoted string with one or both of the following keywords:

unit
and an SDO_UNIT value from the MDSYS.SDO_DIST_UNITS table. See Section 2.8 for more information about unit of measurement specification.

arc_tolerance
and an arc tolerance value. See the Usage Notes for the SDO_GEOM.SDO_ARC_DENSIFY function in Chapter 15 for more information about the arc_tolerance
keyword.
For example: 'unit=km arc_tolerance=0.05'
If the input geometry is geodetic data, this parameter is required, and arc_tolerance
must be specified. If the input geometry is Cartesian or projected data, arc_tolerance
has no effect and should not be specified.
If this parameter is not specified for a Cartesian or projected geometry, or if the arc_tolerance
keyword is specified for a geodetic geometry but the unit
keyword is not specified, the unit of measurement associated with the data is assumed.
Usage Notes
start_measure
and end_measure
can be any points on the geometric segment. They do not have to be in any specific order. For example, start_measure
and end_measure
can be 5 and 10, respectively, or 10 and 5, respectively.
The direction and measures of the resulting geometric segment are preserved (that is, they reflect the original segment).
The geometry type of geom_segment
must be line or multiline. For example, it cannot be a polygon.
An exception is raised if geom_segment
, start_measure
, or end_measure
is invalid.
Examples
The following example returns the geometric segment 2 distance units to the left (positive offset 2) of the segment from measures 5 through 10 of Route 1. Note in SDO_ORDINATE_ARRAY of the returned segment that the Y values (6) are 2 greater than the Y values (4) of the relevant part of the original segment. (This example uses the definitions from the example in Section 7.7.)
 Create a segment offset 2 to the left from measures 5 through 10.
 First, display the original segment; then, offset.
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))
SELECT SDO_LRS.OFFSET_GEOM_SEGMENT(a.route_geometry, m.diminfo, 5, 10, 2)
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.OFFSET_GEOM_SEGMENT(A.ROUTE_GEOMETRY,M.DIMINFO,5,10,2)(SDO_GTYPE, SDO_SR

SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
5, 6, 5, 10, 6, 10))
SDO_LRS.PERCENTAGE_TO_MEASURE
Format
SDO_LRS.PERCENTAGE_TO_MEASURE(
geom_segment IN SDO_GEOMETRY,
percentage IN NUMBER
) RETURN NUMBER;
or
SDO_LRS.PERCENTAGE_TO_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
percentage IN NUMBER
) RETURN NUMBER;
Description
Returns the measure value of a specified percentage (0 to 100) of the measure range of a geometric segment.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 percentage

Percentage value. Must be from 0 to 100. This function returns the measure value corresponding to this percentage of the measure range.
Usage Notes
This function returns the measure value corresponding to the specified 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
has an invalid geometry type or dimensionality, or if percentage
is less than 0 or greater than 100.
Examples
The following example returns the measure that is 50 percent of the measure range of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.) The measure range of this segment is 27, and 50 percent of 27 is 13.5.
SELECT SDO_LRS.PERCENTAGE_TO_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.PERCENTAGE_TO_MEASURE(A.ROUTE_GEOMETRY,M.DIMINFO,50)

13.5
SDO_LRS.PROJECT_PT
Format
SDO_LRS.PROJECT_PT(
geom_segment IN SDO_GEOMETRY,
point IN SDO_GEOMETRY,
tolerance IN NUMBER DEFAULT 1.0e8
[, offset OUT NUMBER]
) RETURN SDO_GEOMETRY;
or
SDO_LRS.PROJECT_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY
[, point_dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
or
SDO_LRS.PROJECT_PT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY,
point_dim_array IN SDO_DIM_ARRAY
[, offset OUT NUMBER]
) RETURN SDO_GEOMETRY;
Description
Returns the projection point of a specified point. The projection point is on the geometric segment.
Parameters
 geom_segment

Geometric segment to be checked.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 point

Point to be projected.
 tolerance

Tolerance value (see Section 1.5.5 and Section 7.6). The default value is 0.00000001.
 point_dim_array

Dimensional information array corresponding to point
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 offset

Offset (shortest distance) from the point to the geometric segment.
Usage Notes
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.
If you specify the output parameter offset
, the function stores the signed offset (shortest distance) from the point to the geometric segment. For more information about the offset to a geometric segment, see Section 7.1.5.
An exception is raised if geom_segment
or point
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.PROJECT_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
For more information about projecting a point onto a geometric segment, see Section 7.5.9.
Examples
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 7.7.)
 Point 9,3,NULL is off the road; should return 9,4,9.
SELECT SDO_LRS.PROJECT_PT(route_geometry,
SDO_GEOMETRY(3301, NULL, NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
SDO_ORDINATE_ARRAY(9, 3, NULL)) )
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.PROJECT_PT(ROUTE_GEOMETRY,SDO_GEOMETRY(3301,NULL,NULL,SDO_EL

SDO_GEOMETRY(3301, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(
9, 4, 9))
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

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 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 Section 7.4.
For more information about redefining a geometric segment, see Section 7.5.2.
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 Section 7.7.)
 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))
SDO_LRS.RESET_MEASURE
Format
SDO_LRS.RESET_MEASURE(
geom_segment IN OUT SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]);
Description
Sets all measures of a geometric segment, including the start and end measures, to null values, overriding any previously assigned measures.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
Examples
The following example sets all measures of a geometric segment to null values. (This example uses the definitions from the example in Section 7.7.)
 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))
 Reset geometric segment measures.
DECLARE
geom_segment SDO_GEOMETRY;
BEGIN
SELECT a.route_geometry into geom_segment FROM lrs_routes a
WHERE a.route_name = 'Route1';
SDO_LRS.RESET_MEASURE (geom_segment);
 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 segment, with all measures set to null.
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, NULL, 2, 4, NULL, 8, 4, NULL, 12, 4, NULL, 12, 10, NULL, 8, 10, NULL, 5, 1
4, NULL))
SDO_LRS.REVERSE_GEOMETRY
Format
SDO_LRS.REVERSE_GEOMETRY(
geom IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
Description
Returns a new geometric segment by reversing the measure values and the direction of the original geometric segment.
Parameters
 geom

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function:

Reverses the measure values of geom
That is, the start measure of geom
is the end measure of the returned geometric segment, the end measure of geom
is the start measure of the returned geometric segment, and all other measures are adjusted accordingly.

Reverses the direction of geom
Compare this function with SDO_LRS.REVERSE_MEASURE, which reverses only the measure values (not the direction) of a geometric segment.
To reverse the vertices of a nonLRS line string geometry, use the SDO_UTIL.REVERSE_LINESTRING function, which is described in Chapter 20.
An exception is raised if geom
has an invalid geometry type or dimensionality. The geometry type must be a line or multiline, and the dimensionality must be 3 (two dimensions plus the measure dimension).
The _3D format of this function (SDO_LRS.REVERSE_GEOMETRY_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example reverses the measure values and the direction of the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
 Reverse direction and measures (for example, to prepare for
 concatenating with another road).
 First, display the original segment; then, reverse.
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))
SELECT SDO_LRS.REVERSE_GEOMETRY(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_GEOMETRY(A.ROUTE_GEOMETRY,M.DIMINFO)(SDO_GTYPE, SDO_SRID, SDO_PO

SDO_GEOMETRY(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
5, 14, 27, 8, 10, 22, 12, 10, 18, 12, 4, 12, 8, 4, 8, 2, 4, 2, 2, 2, 0))
Note in the returned segment that the M values (measures) now go in descending order from 27 to 0, and the segment start and end points have the opposite X and Y values as in the original segment (5,14 and 2,2 here, as opposed to 2,2 and 5,14 in the original).
SDO_LRS.REVERSE_MEASURE
Format
SDO_LRS.REVERSE_MEASURE(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN SDO_GEOMETRY;
Description
Returns a new geometric segment by reversing the measure values, but not the direction, of the original geometric segment.
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function:

Reverses the measure values of geom_segment
That is, the start measure of geom_segment
is the end measure of the returned geometric segment, the end measure of geom_segment
is the start measure of the returned geometric segment, and all other measures are adjusted accordingly.

Does not affect the direction of geom_segment
Compare this function with SDO_LRS.REVERSE_GEOMETRY, which reverses both the direction and the measure values of a geometric segment.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.REVERSE_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Note:
The behavior of the SDO_LRS.REVERSE_MEASURE function changed after release 8.1.7. In release 8.1.7, REVERSE_MEASURE reversed both the measures and the segment direction. However, if you want to have this same behavior with subsequent releases, you must use the SDO_LRS.REVERSE_GEOMETRY function. 
Examples
The following example reverses the measure values of the geometric segment representing Route 1, but does not affect the direction. (This example uses the definitions from the example in Section 7.7.)
 First, display the original segment; then, reverse.
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))
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(3302, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
2, 2, 27, 2, 4, 25, 8, 4, 19, 12, 4, 15, 12, 10, 9, 8, 10, 5, 5, 14, 0))
Note in the returned segment that the M values (measures) now go in descending order from 27 to 0, but the segment start and end points have the same X and Y values as in the original segment (2,2 and 5,14).
SDO_LRS.SET_PT_MEASURE
Format
SDO_LRS.SET_PT_MEASURE(
geom_segment IN OUT SDO_GEOMETRY,
point IN SDO_GEOMETRY,
measure IN NUMBER) RETURN VARCHAR2;
or
SDO_LRS.SET_PT_MEASURE(
geom_segment IN OUT SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
point IN SDO_GEOMETRY,
pt_dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER) RETURN VARCHAR2;
or
SDO_LRS.SET_PT_MEASURE(
point IN OUT SDO_GEOMETRY,
measure IN NUMBER) RETURN VARCHAR2;
or
SDO_LRS.SET_PT_MEASURE(
point IN OUT SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER) RETURN VARCHAR2;
Description
Sets the measure value of a specified point.
Parameters
 geom_segment

Geometric segment containing the point.
 dim_array

Dimensional information array corresponding to geom_segment
(in the second format) or point
(in the fourth format), usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 point

Point for which the measure value is to be set.
 pt_dim_array

Dimensional information array corresponding to point
(in the second format), usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 measure

Measure value to be assigned to the specified point.
Usage Notes
The function returns TRUE if the measure value was successfully set, and FALSE if the measure value was not set.
If both geom_segment
and point
are specified, the behavior of the procedure depends on whether or not point
is a shape point on geom_segment
:

If point
is a shape point on geom_segment
, the measure value of point
is set.

If point
is not a shape point on geom_segment
, the shape point on geom_segment
that is nearest to point
is found, and the measure value of that shape point is set.
The _3D format of this function (SDO_LRS.SET_PT_MEASURE_3D) is available; however, only the formats that include the geom_segment
parameter are available for SDO_LRS.SET_PT_MEASURE_3D. For information about _3D formats of LRS functions, see Section 7.4.
An exception is raised if geomK_segment
or point
is invalid.
Examples
The following example sets the measure value of point (8,10) to 20. (This example uses the definitions from the example in Section 7.7.)
 Set the measure value of point 8,10 to 20 (originally 22).
DECLARE
geom_segment SDO_GEOMETRY;
dim_array SDO_DIM_ARRAY;
result VARCHAR2(32);
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';
 Set the measure value of point 8,10 to 20 (originally 22).
result := SDO_LRS.SET_PT_MEASURE (geom_segment,
SDO_GEOMETRY(3301, NULL, NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
SDO_ORDINATE_ARRAY(8, 10, 22)),
20);
 Display the result.
DBMS_OUTPUT.PUT_LINE('Returned value = '  result);
END;
/
Returned value = TRUE
PL/SQL procedure successfully completed.
SDO_LRS.SPLIT_GEOM_SEGMENT
Format
SDO_LRS.SPLIT_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
split_measure IN NUMBER,
segment_1 OUT SDO_GEOMETRY,
segment_2 OUT SDO_GEOMETRY);
or
SDO_LRS.SPLIT_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
split_measure IN NUMBER,
segment_1 OUT SDO_GEOMETRY,
segment_2 OUT SDO_GEOMETRY);
Description
Splits a geometric segment into two geometric segments.
Parameters
 geom_segment

Geometric segment to be split.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 split_measure

Distance measured from the start point of a geometric segment to the split point.
 segment_1

First geometric segment: from the start point of geom_segment
to the split point.
 segment_2

Second geometric segment: from the split point to the end point of geom_segment
.
Usage Notes
An exception is raised if geom_segment
or split_measure
is invalid.
The directions and measures of the resulting geometric segments are preserved.
The _3D format of this procedure (SDO_LRS.SPLIT_GEOM_SEGMENT_3D) is available. For information about _3D formats of LRS functions and procedures, see Section 7.4.
For more information about splitting a geometric segment, see Section 7.5.4.
Examples
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 7.7. The definitions of result_geom_1
, result_geom_2
, and result_geom_3
are displayed in Example 73.)
DECLARE
geom_segment SDO_GEOMETRY;
line_string SDO_GEOMETRY;
dim_array SDO_DIM_ARRAY;
result_geom_1 SDO_GEOMETRY;
result_geom_2 SDO_GEOMETRY;
result_geom_3 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
Format
SDO_LRS.TRANSLATE_MEASURE(
geom_segment IN SDO_GEOMETRY,
translate_m IN NUMBER
) RETURN SDO_GEOMETRY;
or
SDO_LRS.TRANSLATE_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
translate_m IN NUMBER
) RETURN SDO_GEOMETRY;
Description
Returns a new geometric segment by translating the original geometric segment (that is, shifting the start and end measures by a specified value).
Parameters
 geom_segment

Cartographic representation of a linear feature.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 translate_m

Distance measured from the start point of a geometric segment to the start point of the linear feature.
Usage Notes
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 161.
An exception is raised if geom_segment
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.TRANSLATE_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example translates (shifts) by 10 the geometric segment representing Route 1. (This example uses the definitions from the example in Section 7.7.)
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
Format
SDO_LRS.VALID_GEOM_SEGMENT(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if a geometry object is a valid geometric segment.
Parameters
 geom_segment

Geometric segment to be checked for validity.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
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 SDO_LRS.IS_GEOM_SEGMENT_DEFINED function.
The _3D format of this function (SDO_LRS.VALID_GEOM_SEGMENT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example checks if the geometric segment representing Route 1 is valid. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.VALID_GEOM_SEGMENT(route_geometry)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.VALID_GEOM_SEGMENT(ROUTE_GEOMETRY)

TRUE
SDO_LRS.VALID_LRS_PT
Format
SDO_LRS.VALID_LRS_PT(
point IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if an LRS point is valid.
Parameters
 point

Point to be checked for validity.
 dim_array

Dimensional information array corresponding to point
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
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.
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.
The _3D format of this function (SDO_LRS.VALID_LRS_PT_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example checks if point (9,3,NULL) is a valid LRS point. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.VALID_LRS_PT(
SDO_GEOMETRY(3301, NULL, NULL,
SDO_ELEM_INFO_ARRAY(1, 1, 1),
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(SDO_GEOMETRY(3301,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,1,1),SDO_

TRUE
SDO_LRS.VALID_MEASURE
Format
SDO_LRS.VALID_MEASURE(
geom_segment IN SDO_GEOMETRY,
measure IN NUMBER
) RETURN VARCHAR2;
or
SDO_LRS.VALID_MEASURE(
geom_segment IN SDO_GEOMETRY,
dim_array IN SDO_DIM_ARRAY,
measure IN NUMBER
) RETURN VARCHAR2;
Description
Checks if a measure falls within the measure range of a geometric segment.
Parameters
 geom_segment

Geometric segment to be checked to see if measure
falls within its measure range.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
 measure

Measure value to be checked to see if it falls within the measure range of geom_segment
.
Usage Notes
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
has an invalid geometry type or dimensionality.
The _3D format of this function (SDO_LRS.VALID_MEASURE_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
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 with mile markers at 1mile intervals, there is no 50mile marker because the last marker is the 27mile marker. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.VALID_MEASURE(route_geometry, 50)
FROM lrs_routes WHERE route_id = 1;
SDO_LRS.VALID_MEASURE(ROUTE_GEOMETRY,50)

FALSE
SDO_LRS.VALIDATE_LRS_GEOMETRY
Format
SDO_LRS.VALIDATE_LRS_GEOMETRY(
geom_segment IN SDO_GEOMETRY
[, dim_array IN SDO_DIM_ARRAY]
) RETURN VARCHAR2;
Description
Checks if an LRS geometry is valid.
Parameters
 geom_segment

Geometric segment to be checked.
 dim_array

Dimensional information array corresponding to geom_segment
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Section 2.6).
Usage Notes
This function returns TRUE if geom_segment
is valid and one of the following errors if geom_segment
is not valid:
The _3D format of this function (SDO_LRS.VALIDATE_LRS_GEOMETRY_3D) is available. For information about _3D formats of LRS functions, see Section 7.4.
Examples
The following example checks if the Route 1 segment is a valid LRS geometry. (This example uses the definitions from the example in Section 7.7.)
SELECT SDO_LRS.VALIDATE_LRS_GEOMETRY(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.VALIDATE_LRS_GEOMETRY(A.ROUTE_GEOMETRY,M.DIMINFO)

TRUE
PKkp)PKMFOEBPS/query_mbrs.gifGIF89a???yyy<<<Ã̤ر"""fffCCCXXX&&&YYYjjjnnn>>>...GGG;;;{{{www!!!HHHbbbTTT222LLL%%%\\\UUU777sss렠$$$aaa000}}}DDD @@@eeeiii,,,888uuuqqqmmmEEE]]]hhhPPPIII###+++QQQAAA```,@
(xpaB
*qC/Rh1ǎ +8rɄ\ɲ˗0cʜI͛?S'ɟ'}
'ѡ;$0iPJJիXjɴ逧[ÊKٳRxmJ۷7KZm;W/߿_vmo[
#^7+3U%c[2ϠCӨS}Yk_flٔoFM۴ݡuسKO03NloճkKvȿe3xϛ
zߋ5>59vXuf_7uU2UDEa9_3ч(_,v6X
8i1(7ڈ:B/X׆ HdKJFY>FR2V!%gRׅrYՈefc(ӂvʙ
"'Y+F5MZ߄dpV(iyZpYh5hJ"JjԩP
*xiX=ZZ!UFƊUY KmҴfŶynזGnN$
Vfrz7/ƔYqL.llֹlǵŤMl/Uʄ.br⥬r< CҬ[jm%(+_*+Ͳiѿ@@JH@X1]p6+g
r2\@, tAAB#@B !MZZ4~pBA(@
1Ж(4
_zӋS 0
,AgҞ~_C @2`PCA@=z!u}X_0lЁFowւF.[㟵`IB@>@mz[RL5\!VH)oKpʧ
2X!
Kz0y^A
A6pȦbSj/ŉ IB*x6MY&ɤ,=YNz\
HR)%L$UY%DGegIK:R!uc#}2 [&}!.bLt c,dxLaEMf5m4aifUMc9%dLtaY:NV5)rjEa)9'ACO~GCΈ˛כn^fŞEuC08ǂѓh*%:]pZԣ4NEc+^*hLYUbwo2M%b(G oz/_kۚ)`xR
v+mrא>&*xFK{by]\PC q5'ŘMq
2MՆcE%j1!
8F8BPcDyԖ!,Y#$A K`Bw%aL7' R=P(L
PxPLY
"j4c5,dAJ$Al`B
EhI$ǘ'4QJ[56`1!SU(@ʐ&6Yh8å52aG,YBoqtU.}Fم22e4,}/+ٴU2e#8S^+d
p@r8 rpkc3+q[
?:<:ks0P:$'pA!(jIV;y27=B: rx[/0A`pA}hu
iȂ⳰21ƙ
@jSf5^Yza~9g=VC2cڙΆmmmg{ms䤷B qPBfм1p;
r\XCGk'
GQp:'rr7uwxQwz/TVaitBGtFtqtLtPph120qslCwvwww'xGFE2Cjp_nzz{{wS)10n2bjJ7}էKקR4.'Z+?[g1Wmn3BHi6by$^BmMN~/%T'xSo_x"fX~ԥHV/,g'Ep_Debha8Vq+JK'BPŊ3[&fqV%3qV\,6GcqVW*%b^Ĩ4Z5l0(&52'S1 _ha`!NxaH&H_IxKuZSO/u+?&W4HfcP^p1(.)N1:Z$Y}^ts(PLXx]QNEՎnQ0!AsL/ J12DlXYElHQ&RHz~AIqqKlEmc4FYsRɧ7vcSv$
`~ْ!i;Fs8e,4DqY{4;)`.E 2@Y^Ny_֚)(㸓zQr*#l9'qőwWȩTYO;)Q9(!,YY rB& x)M9`9y( 5xFoYkyLɞ4nԕ'FzhBtɜ84RɡuŘYV"*VrG2T X*:mKzbafjUy
Su/TyGqP0w媒B_us0(jj1]gbv~h~gfh.K'Qy6jvjjyFkZ,~pZ2ʫ@Qg6mvmGmr&ncw@u:}}p pgpJ3i1g 'r%gr(rgx]D'
ܥCWtGtKtt[BIp}]V02xwyw})98xA˱mUzK/LhzQ(A^[)#G}4\fu$ 2uhikf_5ˡg굁NZ(~DzyL!$F˜+pv['+QK;Q;*g먹GMQ;+?;PK]nPKMFOEBPS/sdodiff.gif
GIF89a~~~333WWW???rrrfffKKK$$$DDDUUUwww""",` dihlp
tmxpH,Ȥrl:tJ~ϬvzQxl~:&8zNg[nxzek=Mql:c1,e~TWs};µ"ǺnŷO6Ѭ\WFAHC0`9Z&+
T9љ+1_:zKȑ$_926,[&̙ؼ3mP@y@dR
O`A h͊ h%0@CEJEXU@48ipU\o5
DSe>ٌȱ{
3 2C`Zssc=v}׀_Â {z6m`mbE(;4qH5bٵ6A`o ʌ?f
fT >JHaD@{E@x` sm7vzŠ,琕+ܰ^me,NMN)kҋL^oROߪꯟ~`DO})B;PKxUPKMFOEBPS/query.gifGIF89av???%%%)))333ǱrrraaaGGGĨ...С!!!LLL;;;ز777YYY]]]TTT***{{{CCCnnn"""ݺeeeUUU&&&jjjwww222թKKKsssDDDfffȔSSSiiibbbPPP666:::zzz```XXXBBBvvvHHH\\\,vĒϓӻ݅윾To AK`!JaA.bLWcč:f
CQ%LSOJHordOJ(DsXQ,@jSgNB $Qn*L
B
0dа:xD @B#(L4<B0zNv+!:l`.^^?`AltC
'dH@i!#
Tq7TB4Yb}J&,*`B*l^{91{p"
AE! #!81B@P
ǐZI'Jؠ[<,HCA:HEI$f5i K9 8p`kp{ԨݳB.\(]dUk3HIČL#::>R9a(GЊWc&9HX̮p$o!IZrъ%7
AcwLR2))H
yqY#aGͽ1l\٨4@L+K+z\Q"TU"X4X,df33K4ft5M9Ӗ YfBv ':YH&:Y CnjBxrNR
zzSY%'
&Yt2`Qz0J+UC?lt8rX0n @A7@0B"^jPlX` `$@`å7dGJ
8o\P0'aDֺ
ЪczOs8+$ppD(0Vԝ#HɹJ ЀBX@B!ZAJx JDLa1<A[4G(0N.FH)a; BP
*^I*^vk;,06@nu//݂s]ڢ!*M (AjoME5f!0y
Ę(ְݰS(@
LqO'@
,X@G&q/qB!Li 8`(D!PmLP$ d}4
pX
օ0ED{BPX ,`C&Dy$gd^
48$Hh<,JLF3`@m kh}@7MgK31mTP
kCY2GxHPC2LaUxm$)AAw7ZaVHt#]w(O^wݽB"W 5"
G\;4}EPŵ(Q16a&@7@ڀ!ktmЙ8\
TܖAfpSpP1O1( '7 șCM[v'~8%v"f[@֡~/0[½#JJ
`\@#$L`@I[Xl@@7!C^ma!.COAhvוyvm6{#Pr{IfuSr'@Z"K}`[9( `#@<. ,u_Ew<
027P=SD/_e`@0`_]S7L33/XwEL,4UGsPDPN0q\Ey)px{g78e8%NY8討EW@@@6P6mQD(~gtw&C7AciROdÑ #TB^Ӈ&6J P`oWVxB #8"d}W7?(w
.WQHDvsWlL*%;[
\镑vѕBCA4D' )p,k@R&RwE)y5h@g]զ[}W
' hj8]fDBxHP] C3`8a4FPS} AuaX@DrEW7 К6f>@V1"KYFOlXW @5E ^YZ$>00;60F} [5\`vطwxhxɞz &7 91kYjew&
ulnGܙ u_&` M`co2f3 `Jzbtڹ? "Pbb@up6q`G@DgjSVecTEkJi`ٶm]Ha
B&ZFڏh@hk(Ux6` HVn4 %"yY&)yA7+9jPp@FOzZ:P唗z(ZvHᬚب:Gsju>J;$Ja:sfoDM
a7!躬ƠJ
*jbUJKW)
:49k6GLztk5{F˱9G!{pn+6+)t')3ëGZ7К9+ڰ=LQN[8R [l٫HOك1( P[KBѯ*.H1h{n[Tk0b{@me?˷tk}EY2ۮm5rq[z{^K[Q٥%Z[˲2Ek[
K;+!+ 纖{Ǜakl:![su{ꊲɛUkHKȫdLۺ[۾6kK˼6 ˏ[6,dKkK蠻S+ aàۿcvPK¥&\Vhś
Conceptual and Usage Information
Part I
Conceptual and Usage Information
This document has three parts:

Part I provides conceptual and usage information about Oracle Spatial.

Part II provides reference information about Oracle Spatial operators, functions, and procedures.

Part III provides supplementary information (appendixes and a glossary).
Part I is organized for efficient learning about Oracle Spatial. It covers basic concepts and techniques first, and proceeds to more advanced material (such as coordinate systems, the linear referencing system, geocoding, and extending spatial indexing). Part I contains the following chapters:
PKȼPKMFOEBPS/darbbook.cssB/* ========================================================================== */
/* darbbook.css */
/* Release 0.0.1 */
/* Last revision 02/07/03 */
/* 2003, Oracle Corporation. All rights reserved. */
/* ========================================================================== */
/* This is not intended to be a standalong CSS. Instead, it cascades on */
/* top of the BLAF CSS, providing minimal changes to the existing styles */
/* in BLAF, while defining further styles for DARBspecific classes. */
/******************************************************************************/
/* BLAF Overrides/Additions */
/******************************************************************************/
/* First, we need a couple tweaks to the BLAF CSS. */
/* H4 needs to be weight BOLD, as "normal" is too light for accessibility */
H4 {
fontweight:bold;
}
/* BLAF doesn't include styles for H5/H6, so we'll include them. Same */
/* Font family as H1H4, just slightly smaller and BOLD as well. */
H5, H6 {
fontfamily: Arial, Helvetica, Geneva, sansserif;
color:#336699;
backgroundcolor : #FFFFFF;
}
H5 {
fontsize: 0.9em;
fontweight: bold;
}
H6 {
fontsize: 0.7em;
fontweight: bold;
}
/* Loose the H1 underscore */
H1 {
borderwidth : 0px 0px 0px 0px;
}
/* BLAF doesn't provide much contrast between links and visited links */
/* so we'll add a little red to increase contrast. */
A:visited {
color : #AA3300;
backgroundcolor : #FFFFFF;
}
/******************************************************************************/
/* DARBspecific formats */
/******************************************************************************/
.bold {
fontweight: bold;
}
.italic {
fontstyle: italic;
}
.bolditalic {
fontweight: bold;
fontstyle: italic;
}
.codeinlinebold {
fontweight: bold;
}
.codeinlineitalic {
fontstyle: italic;
}
.codeinlineboldital {
fontweight: bold;
fontstyle: italic;
}
.syntaxinlinebold {
fontweight: bold;
}
.syntaxinlineitalic {
fontstyle: italic;
}
.syntaxinlineboldital {
fontweight: bold; fontstyle: italic;
}
.bridgehead {
fontfamily: Arial, Helvetica, Geneva, sansserif;
color:#336699;
backgroundcolor : #FFFFFF;
fontweight: bold;
}
.titleinrefsubsect {
fontfamily: Arial, Helvetica, Geneva, sansserif;
fontsize:1.2em;
color:#336699;
backgroundcolor : #FFFFFF;
fontweight: bold;
fontsize:1.2em;
}
.term, .glossterm {
fontweight: bold;
}
.glossaryterm {
fontweight: bold;
}
.keyword {
fontweight: bold;
}
.seghead {
fontweight: bold;
}
.variable {
fontstyle: italic;
}
.msg, .msgexplankw, .msgactionkw {
fontweight: bold;
}
.underline {
textdecoration: underline;
}
.superscript {
verticalalign: super;
}
.subscript {
verticalalign: sub;
}
.listofeft {
border: none;
}
.titleinfigure, .titleinexample, .titleintable, .titleinequation {
fontweight: bold;
fontstyle: italic;
}
.notep1 {
fontweight: bold;
}
.subhead1, .subhead2, .subhead3 {
fontfamily: Arial, Helvetica, Geneva, sansserif;
color: #336699;
backgroundcolor : #FFFFFF;
fontweight: bold;
}
.subhead1 {
fontsize:1.1em;
}
.subhead2 {
fontsize:1.0em;
}
.subhead3 {
fontsize:0.9em;
display: inline;
}
/* When lists are inside tables, they need to be more "compact" so they don't */
/* spread the table out. We need to suppress the natural line break in the */
/* para element for "paras inside a list item inside a table data" */
td li p {
display: inline;
}
TD.copyrightlogo {
textalign:center;
fontsize: xxsmall;
}
SPAN.copyrightlogo {
textalign:center;
fontsize: xxsmall;
}
IMG.copyrightlogo {
borderstyle:none;
}
p.betadraftsubtitle {
textalign:center;
fontweight:bold;
color:#FF0000;
}
.betadraft {
color:#FF0000;
}
.comment {
color:#008800;
}
PKGBPKMFOEBPS/lrs_tol.gifwGIF89aX=LLLԿ؇Ð嘘픔???%%%TTT\\\...{{{&&&!!!zzz"""fff222;;;HHH666)))YYYnnnjjjwwwGGG鏏^^^ܺDDD]]]:::bbbsssKKKvvvrrrUUU***777PPPCCCXXXaaa333dddeeeiii}SSS,X=
Ȭ
ɯʺ
AD_C `P 4dh#H+Q!N<@
FpĥP`EOI5Icҥ#(<(a)%I]Е!d͖`+)`$t.Ѩ!I$\CwKȑ'[ E^f_[u74Zem
C
At ՠ;pnpu5x0PEP!yA ńp@ (װe>]z׳'v Ҁ0D`
"^LX
g aD^YvtW+DJ)%P'&`H" &bR**YS2
2L7@[M8_Rd@ҥ `JPOPw10Q[M!H ?b ME qYӕdy(n)Hwy"vVޘ_f'Q@TtTV*f)J>hs
bEcQvM*z'\OQj*Jk+[챳kNg~0QT8HpL/!n
ʻb ԐE0hAoSL(2
<^HL;O,[ZY<Ƅẖ w1 ,gB'@L\uc
{2 XD"l@@,0хRxbޝw,+
[6Vc͛xSNb6)7F"dv(?$CBzH0oI"6JRw&deމL.$觯(7R~$WȾpoJ؎X G$`!:'H
Z00' 1!(L(P0PC Pw@CPcam(P
$G*ZXbD("B^QH@LQ{ 6%"a1ؑk!ḚІBH&p"u
List of Figures
PK^
*%PKMFOEBPS/sdo_objindex.htm
SQL Statements for Indexing Spatial Data
10 SQL Statements for Indexing Spatial Data
This chapter describes the SQL statements used when working with the spatial object data type. The statements are listed in Table 101.
This chapter focuses on using these SQL statements with spatial indexes. For complete reference information about any statement, see Oracle Database SQL Reference.
Bold italic text is often used in the Keywords and Parameters sections in this chapter to identify a grouping of keywords, followed by specific keywords in the group. For example, INDEX_PARAMS identifies the start of a group of indexrelated keywords.
ALTER INDEX
Purpose
Alters specific parameters for a spatial index.
Syntax
ALTER INDEX [schema.]index PARAMETERS ('index_params [physical_storage_params]' )
[{ NOPARALLEL  PARALLEL [ integer ] }] ;
Keywords and Parameters
Prerequisites
Usage Notes
Use this statement to change the parameters of an existing index.
See the Usage Notes for the CREATE INDEX statement for usage information about many of the other available parameters.
Examples
The following example modifies the tablespace for partition IP2 of the spatial index named BGI.
ALTER INDEX bgi MODIFY PARTITION ip2
PARAMETERS ('tablespace=TBS_3');
Related Topics
ALTER INDEX REBUILD
Syntax
ALTER INDEX [schema.]index REBUILD
[PARAMETERS ('rebuild_params [physical_storage_params]' ) ]
[{ NOPARALLEL  PARALLEL [ integer ] }] ;
or
ALTER INDEX [schema.]index REBUILD ONLINE
[PARAMETERS ('rebuild_params [physical_storage_params]' ) ]
[{ NOPARALLEL  PARALLEL [ integer ] }] ;
or
ALTER INDEX [schema.]index REBUILD PARTITION partition
[PARAMETERS ('rebuild_params [physical_storage_params]' ) ];
Purpose
Rebuilds a spatial index or a specified partition of a partitioned index.
Keywords and Parameters
Prerequisites
Usage Notes
An ALTER INDEX REBUILD 'rebuild_params' statement rebuilds the index using supplied parameters. Spatial index creation involves creating and inserting index data, for each row in the underlying table column being spatially indexed, into a table with a prescribed format. All rows in the underlying table are processed before the insertion of index data is committed, and this requires adequate rollback segment space.
The ONLINE keyword rebuilds the index without blocking the index; that is, queries can use the spatial index while it is being rebuilt. However, after all queries issued during the rebuild operation have completed, you must clean up the old index information (in the MDRT tables) by entering a SQL statement in the following form:
ALTER INDEX [schema.]index REBUILD ONLINE PARAMETERS ('index_status=cleanup');
The following limitations apply to the use of the ONLINE keyword:

Only query operations are permitted while the index is being rebuilt. Insert, update, and delete operations that would affect the index are blocked while the index is being rebuilt.

You cannot use the ONLINE keyword for a rebuild operation if the index was created using the 'sdo_non_leaf_tbl=TRUE'
parameter.

You cannot use the ONLINE keyword for a partitioned spatial index.
The ALTER INDEX REBUILD statement does not use any previous parameters from the index creation. All parameters should be specified for the index you want to rebuild.
For more information about using the layer_gtype
keyword to constrain data in a layer to a geometry type, see Section 4.1.2.
With a partitioned spatial index, you must use a separate ALTER INDEX REBUILD statement for each partition to be rebuilt.
See also the Usage Notes for the CREATE INDEX statement for usage information about many of the available parameters and about the use of the PARALLEL keyword.
Examples
The following example rebuilds OLDINDEX and specifies the tablespace in which to create the index data table.
ALTER INDEX oldindex REBUILD PARAMETERS('tablespace=TBS_3');
Related Topics
ALTER INDEX RENAME TO
Syntax
ALTER INDEX [schema.]index RENAME TO <new_index_name>;
ALTER INDEX [schema.]index PARTITION partition RENAME TO <new_partition_name>;
Purpose
Changes the name of a spatial index or a partition of a spatial index.
Keywords and Parameters
Prerequisites
Usage Notes
None.
Examples
The following example renames OLDINDEX to NEWINDEX.
ALTER INDEX oldindex RENAME TO newindex;
Related Topics
CREATE INDEX
Syntax
CREATE INDEX [schema.]index ON [schema.]table (column)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
[PARAMETERS ('index_params [physical_storage_params]' )]
[{ NOPARALLEL  PARALLEL [ integer ] }];
Purpose
Creates a spatial index on a column of type SDO_GEOMETRY.
Keywords and Parameters
Prerequisites

All current SQL CREATE INDEX prerequisites apply.

You must have EXECUTE privilege on the index type and its implementation type.

The USER_SDO_GEOM_METADATA view must contain an entry with the dimensions and coordinate boundary information for the table column to be spatially indexed.
Usage Notes
For information about spatial indexes, see Section 1.7.
Before you create a spatial index, be sure that the rollback segment size and the SORT_AREA_SIZE parameter value are adequate, as described in Section 4.1.
If an Rtree index is used on linear referencing system (LRS) data and if the LRS data has four dimensions (three plus the M dimension), the sdo_indx_dims
parameter must be used and must specify 3 (the number of dimensions minus one), to avoid the default sdo_indx_dims
value of 2, which would index only the X and Y dimensions. For example, if the dimensions are X, Y, Z, and M, specify sdo_indx_dims=3
to index the X, Y, and Z dimensions, but not the measure (M) dimension. (The LRS data model, including the measure dimension, is explained in Section 7.2.)
A partitioned spatial index can be created on a partitioned table. See Section 4.1.4 for more information about partitioned spatial indexes, including benefits and restrictions.
A spatial index cannot be created on an indexorganized table.
You can specify the PARALLEL keyword to cause the index creation to be parallelized. For example:
CREATE INDEX cola_spatial_idx ON cola_markets(shape)
INDEXTYPE IS MDSYS.SPATIAL_INDEX PARALLEL;
For information about using the PARALLEL keyword, see the description of the parallel_clause
in the section on the CREATE INDEX statement in Oracle Database SQL Reference. In addition, the following notes apply to the use of the PARALLEL keyword for creating or rebuilding (using the ALTER INDEX REBUILD statement) spatial indexes:

The performance cost and benefits from parallel execution for creating or rebuilding an index depend on system resources and load. If the CPUs or disk controllers are already heavily loaded, you should not specify the PARALLEL keyword.

Specifying PARALLEL for creating or rebuilding an index on tables with simple geometries, such as point data, usually results in less performance improvement than on tables with complex geometries.
Other options available for regular indexes (such as ASC and DESC) are not applicable for spatial indexes.
Spatial index creation involves creating and inserting index data, for each row in the underlying table column being spatially indexed, into a table with a prescribed format. All rows in the underlying table are processed before the insertion of index data is committed, and this requires adequate rollback segment space.
If a tablespace name is provided in the parameters clause, the user (underlying table owner) must have appropriate privileges for that tablespace.
For more information about using the layer_gtype
keyword to constrain data in a layer to a geometry type, see Section 4.1.2.
The 'geodetic=FALSE'
parameter is not recommended, because much of the Oracle Spatial geodetic support will be disabled. This parameter should only be used if you cannot yet reindex the data. (For more information about geodetic and nongeodetic indexes, see Section 4.1.1.)
Moreover, if you specify 'geodetic=FALSE'
, ensure that the tolerance value stored in the USER_SDO_GEOM_METADATA view is what would be used for Cartesian data. That is, do not use meters for the units of the tolerance value, but instead use the number of decimal places in the data followed by a 5 (for example, 0.00005). This tolerance value will be used for spatial operators. When you use spatial functions that require a tolerance value with this data, use the function format that lets you specify a tolerance value, and specify the tolerance value in meters.
The sdo_dml_batch_size
parameter can improve application performance, because Spatial can preallocate system resources to perform multiple index updates more efficiently than successive single index updates; however, to gain the performance benefit, you must not perform commit operations after each insert operation or at intervals less than or equal to the sdo_dml_batch_size
value. You should not specify a value greater than 10000 (ten thousand), because the cost of the additional memory and other resources required will probably outweigh any marginal performance increase resulting from such a value.
Specifying 'sdo_non_leaf_tbl=TRUE'
can help query performance with large data sets if the entire Rtree table may not fit in the KEEP buffer pool. In this case, you must also cause Oracle to buffer the MDNT_...$ table in the KEEP buffer pool, for example, by using ALTER TABLE and specifying STORAGE (BUFFER_POOL KEEP). For partitioned indexes, the same sdo_non_leaf_tbl
value must be used for all partitions. Any physical storage parameters, except for tablespace
, are applied only to the MDRT_...$ table. The MDNT_...$ table uses only the tablespace
parameter, if specified, and default values for all other physical storage parameters.
If you are creating a functionbased spatial index, the number of parameters must not exceed 32. For information about using functionbased spatial indexes, see Section 9.2.
To determine if a CREATE INDEX statement for a spatial index has failed, check to see if the DOMIDX_OPSTATUS column in the USER_INDEXES view is set to FAILED. This is different from the case of regular indexes, where you check to see if the STATUS column in the USER_INDEXES view is set to FAILED.
If the CREATE INDEX statement fails because of an invalid geometry, the ROWID of the failed geometry is returned in an error message along with the reason for the failure.
If the CREATE INDEX statement fails for any reason, then the DROP INDEX statement must be used to clean up the partially built index and associated metadata. If DROP INDEX does not work, add the FORCE parameter and try again.
Examples
The following example creates a spatial Rtree index named COLA_SPATIAL_IDX.
CREATE INDEX cola_spatial_idx ON cola_markets(shape)
INDEXTYPE IS MDSYS.SPATIAL_INDEX;
Related Topics
DROP INDEX
Syntax
DROP INDEX [schema.]index [FORCE];
Purpose
Deletes a spatial index.
Keywords and Parameters
Prerequisites
You must have EXECUTE privileges on the index type and its implementation type.
Usage Notes
Use DROP INDEX indexname FORCE to clean up after a failure in the CREATE INDEX statement.
Examples
The following example deletes a spatial index named OLDINDEX and forces the deletion to be performed even if the index is marked inprocess or an error occurs.
DROP INDEX oldindex FORCE;
Related Topics
PK;G[{PKMFOEBPS/query_window.gifGIF89a???yyy<<<Ã̤ر"""ٝfffCCCXXX&&&YYYjjjnnn>>>ddd%%%DDD...GGG;;;{{{ssswww!!!HHHbbbvvvKKKrrrPPPTTT222LLL\\\]]]UUUaaa777iii***$$$MMMQQQqqq444'''˪mmm333888 )))000}}}@@@eee,,,uuuEEEhhhIII###+++AAA```,@
(xpaB
*qC/Rh1ǎ +8rɄ\ɲ˗0cʜI͛?S'ɟ'}
'ѡ;$0iPJJիXjɴ逧[ÊKٳRxmJ۷7KZm;W/߿_vmo[
#^7+3U%c[2ϠCӨS}Yk_flٔoFM۴ݡuسKO03NloճkKvȿe3x+Vaw?_>yzt_Va
JXFᄽe!v^(j⇏vhT)
} @4$5ިd\]\MVyZwlYEZR&w]RE&Q^FdXYfeY4YY条XxnD'hĈ1٧{U{VNJ(fghӖf5j2j&&Yfi]k2hڊ \tB+*l˺T{WҤ+KnjPNV]חckWR[U:%Zo{@4kUlVuaV͒[յZ
 3%oZ6DrO%a GV*SZvtT5E]r5QX0v\V,=횝3#jSrL㚊ض2NF}99xOmBy` tT[Wo1)_~i^Ŷ @@JH@X1]pek$ @zrepAl$$P "06q9p(H
p\f{Z
VP(a.mX`t3BЂ
2AiD7h
lPT 8'D @]+ʀ=q HЦ(%;@
!AX!܇@CH #l@
+gK׳khRZ4eKm[uKq+;]``L:W82UIfr51724)nUp
mLB`řTvAvXY]
CM0Y2^*'X*i=jb^Vng>JO_lFUm47ヿNu}XNK^WNuq}?,bEYG
!@R 3v(^Zpgo.z(`GU{SD%1vlo+z2_U @5^AgAy2w~B\AN$DNYx4S7b+ah6Å照kX2i8Ն²twx(`CAu8ǇW@U/w+XȈ7=d%؈}t_jA^$ԅoXyշv+6gt5wsrP:`Q&I~aPT4xjxbX80:/Z[PHS[f)npǌ4vm1:c@P0cPNp6K0k0pk7hQg,w4"8pG]hg(rD
w)P">yBy0x/WNs,v"!
\Y[G/03v0ooitb1\rPgy4u.HLaa0WBtHi0_ߒ 0 9 @Qk 1C Bx%M9uG4ɗB peP ` mК;Y2@x98xy؎X}@,RHw0s I 3 _ٛ5)[ {P{8tCC_
y#iy i6o7cPd8wo ڡy92B`8n<9@ICY
sJɔf ~7 4@TPawWod$`f\jYlyn GI0.i5Ö1:P0x4xWc4z9g t39qJz`8Z7Asp4,ڧڛzJBE5ƚ Id`BR7e8y%6ws$SsڪZi%j`DI`詞qq*7zri.!8KʪaZzzcFhc,1pjB
*oŨ?A*7:ʣ>
8.QsrK؆*yӥ_zY)!&鯽X7*Ȩ2Wt҇V` yL '`Ӊ4ƺr僪A5+=1Gٲ,XB;r5*Ź<ˈ?}PKRK3`k/z1k8]貈aaˡiYJy9g:[;H0.!Ǚ#ǡizJ1stK2#$F+{Y멼eh+_$%h˸Fx73q4U+~`O):غ*Cek+B;k]G@+6Qv˝bHخkW돞S :tW2ۏim'};s6Ȃ!G%۷4ZSK]ED4;pvxePQ
p6lkznscw.00}v*tڴɨ`<8N>U(K;~3'I$LzD\%'§Bl$xG
ƴ%\5;1Ƣp},YtBɂLMw26.Wbů'#Z٢Hmq3ȜhMcĪfI}!7gz阑)i;sE+I&YYPC @Pk6:yڞɩZ2Sv/}4zht j߶!;ڣ?JwA
W+{.7A}}~`w7
NtZl~,Dmq4^'+>*:$SW}HoCN\^`GZ^\f]c;PK @
PKMFOEBPS/sdo_route_server.htm
Routing Engine
C Routing Engine
The Spatial routing engine enables you to host an XMLbased Web service that provides the following features:

For an individual route request (a start location and an end location): route information (driving distances, estimated driving times, and directions) between the two locations

For a batch route request (multiple routes, with the same start location but different end locations): route information (driving distance and estimated driving time) for each route
For any request, the start and end locations are identified by addresses, geocoded results, or longitude/latitude coordinates.
The routing engine is implemented as a Java 2 Enterprise Edition (J2EE) Web application that you can deploy in either an Oracle Application Server or standalone Oracle Application Server Containers for J2EE (OC4J) environment.
Figure C1 shows the basic flow of action with the routing engine: a client locates a remote routing engine instance, sends a route request, and processes the route response returned by the routing engine instance.
This chapter contains the following major sections:
C.1 Deploying and Configuring the Routing Engine
To enable the routine engine to process routing requests and to generate responses, you must deploy the routeserver.ear
file using OC4J or the Oracle Application Server. This section describes the basic steps.

Add the following element inside the <website> element in your httpwebsite.xml or defaultwebsite.xml file of OC4J:
<webapp application="routeserver"
name="web"
loadonstartup="true"
root="/routeserver"
maxinactivitytime="no shutdown"
shared="false" />

Use the Oracle Application Server console to deploy the routeserver.ear
file, or add the following element inside the <applicationserver>
element in the server.xml
file of OC4J (replace <ROUTE_SERVER_HOME>
accordingly):
<application name="routeserver"
path="<ROUTE_SERVER_HOME>/routeserver.ear"
autostart="true" />

Add the following element inside the <applicationserver> element in the server.xml file of OC4J:
<maxhttpconnections value="10" />
It is important to limit the number of concurrent requests that the Oracle Route Server can process at any given time to prevent java.lang.OutOfMemoryError
errors.

Start OC4J using the following command options:
server
Xms<HEAP_SIZE>
Xmx<HEAP_SIZE>
XX:NewSize=<YOUNG_GENERATION_SIZE>
XX:MaxNewSize=<YOUNG_GENERATION_SIZE>
Dsun.rmi.dgc.server.gcInterval=3600000
Dsun.rmi.dgc.client.gcInterval=3600000
verbose:gc (optional)
<HEAP_SIZE>
must be at least 512 MB, and has a recommended size of at least 1024 MB (1 GB). Make sure that this memory is physical memory and not virtual memory.
<YOUNG_GENERATION_SIZE>
should be onefourth (25%) of the <HEAP_SIZE>
value.
verbose:gc will print all minor and major Java garbage collections. Monitoring these statistics could be useful for memory resource planning. If you find that garbage collections are occurring frequently or are lasting several seconds, you probably need to allocate more physical memory to the Java VM.
Note:
The amount of memory the Java VM will need depends mostly on two parameters: the <maxhttpconnections value="..." /> element in the <applicationserver> element in server.xml , and the partition_cache_size_limit parameter in web.xml . 
The following command is an example that starts OC4J. Note that the config flag is an OC4J command line parameter, not a VM option.
c:\jdk1.4.2\bin\java server
Xms1024m
Xmx1024m
XX:NewSize=256m
XX:MaxNewSize=256m
Dsun.rmi.dgc.server.gcInterval=3600000
Dsun.rmi.dgc.client.gcInterval=3600000
verbose:gc
jar c:\oc4j\j2ee\home\oc4j.jar
config c:\oc4j\j2ee\home\config\server.xml

Verify your deployment by visiting the URL in the following format:
http://<hostname>:<port>/routeserver
You should see a welcome page. You should also see a message in the console window in which you started OC4J indicating that the Oracle Route Server was successfully initialized.
If you do not see a welcome message, the route server is probably not configured properly to run in your environment. In this case, edit the <ROUTE_SERVER_HOME>/routeserver/web/WEBINF/web.xml
file to reflect your environment and your preferences. (The web.xml
file is inside the routeserver.ear
file, and it will not be visible until OC4J expands it into the route server directory structure under <ROUTE_SERVER_HOME>
.) When you are finished editing, restart OC4J and verify your deployment.

Consult the supplied examples. The page http://<hostname>:<port>/routeserver/
has links at the bottom in a section named Test Samples. These examples demonstrate various capabilities of the Oracle Route Server. This is the best way to learn the XML API, which is described in Section C.2.
C.2 Routing Engine XML API
This section explains how to submit route requests in XML format to the routing engine, and it describes the XML document type definitions (DTDs) for the route requests (input) and responses (output). XML is widely used for transmitting structured documents using the HTTP protocol. If an HTTP request (GET or POST method) is used, it is assumed the request has a parameter named xml_request
whose value is a string containing the XML document for the request.
A request to the routing engine servlet has the following format:
http://hostname:port/routeserverservletpath?xml_request=xmlrequest
In this format:

hostname is the network path of the server on which the routing engine is running.

port is the port on which the application server listens.

routeserverservletpath is the routing engine servlet path (for example, routeserver/servlet/RouteServerServlet
).

xmlrequest is the URLencoded XML request submitted using the HTML GET or POST method.
The input XML is required for all requests. The output will be an XML document.
In an input route (as opposed to batch route) request, you must specify a route ID, and you can specify one or more of the following attributes:

route_preference
: fastest
or shortest
(default). (Note that for batch route requests, the default is fastest
.)

road_preference
: highway
(default) or local

return_hierarchical_directions
(whether to return hierarchical directions): true
or false
(default)

return_driving_directions
(whether to return driving directions): true
(default) or false

return_route_geometry
(whether to return the line string coordinates for the route): true
or false
(default)

return_detailed_geometry
: true
(default; returns detailed geometries) or false
(returns generalized geometries)

distance_unit
: kilometer
, mile
(default), or meter

time_unit
: hour
, minute
(default), or second

pre_geocoded_locations
(whether the start and end locations are input locations (address specifications or points) or previously geocoded locations): true
(previously geocoded locations) or false
(default; input locations)
In an input batch route request, you must specify a request ID, a start location, and one or more end locations. Each location must have an ID attribute. You can also specify one or more of the following attributes for the batch route request:

route_preference
: fastest
(default) or shortest
. (Note that for individual route requests, the default is shortest
.)

road_preference
: highway
(default) or local

distance_unit
: kilometer
, mile
(default), or meter

time_unit
: hour
, minute
(default), or second

sort_by_distance
(whether to sort the returned routes in ascending order by distance of the end location from the start location: true
or false
(default)

cutoff_distance
(returning only routes where the end location is less than or equal to a specified number of distance units from the start location): (number; default = no limit)

pre_geocoded_locations
(whether the start and end locations are input locations (address specifications or points) or previously geocoded locations): true
(previously geocoded locations) or false
(default; input locations)
This section contains the following subsections:
C.2.1 Route Request and Response Examples
This section contains XML examples of route requests and the responses generated by those requests. One request uses specified addresses, another uses points specified by longitude and latitude coordinates, and another uses previously geocoded locations. For reference information about the available elements and attributes, see Section C.2.2 for requests and Section C.2.3 for responses.
Example C1 shows a request for the fastest route, preferably using highways, between two offices at specified addresses (in Waltham, Massachusetts and Nashua, New Hampshire), with driving directions for each segment, and using miles for distances and minutes for times.
Example C1 Route Request with Specified Addresses
<?xml version="1.0" standalone="yes"?>
<route_request
id="8"
route_preference="fastest"
road_preference="highway"
return_driving_directions="true"
distance_unit="mile"
time_unit="minute">
<start_location>
<input_location id="1">
<input_address>
<us_form1
street="1000 Winter St"
lastline="Waltham, MA" />
</input_address>
</input_location></start_location>
<end_location>
<input_location id="2">
<input_address>
<us_form1
street="1 Oracle Dr"
lastline="Nashua, NH" />
</input_address>
</input_location>
</end_location>
</route_request>
Example C2 shows the response generated by the request in Example C1. (The output is reformatted for readability.)
Example C2 Route Response with Specified Addresses
<?xml version="1.0" ?>
<route_response>
<route
id="8"
step_count="14"
distance="30.28667355371901"
distance_unit="mile"
time="35.02037760416667"
time_unit="minute">
<segment
sequence="1"
instruction="Start out on WINTER ST (Going South)"
distance="1.2041612436793172"/>
<segment
sequence="2"
instruction="Stay STRAIGHT to go onto TOTTEN POND RD (Going East)"
distance="0.08879983757738225"/>
<segment
sequence="3"
instruction="Turn LEFT onto WYMAN ST (Going North)"
distance="0.24681569656886923"/>
<segment
sequence="4"
instruction="Take I95 N RAMP toward PEABODY"
distance="0.23440010735937208"/>
<segment
sequence="5"
instruction="Merge onto I95/RT128 (Going North)"
distance="6.002288440990454"/>
<segment
sequence="6"
instruction="Continue on I95/RT128"
distance="0.0"/>
<segment
sequence="7"
instruction="Stay STRAIGHT to go onto 32B/32A (Going East)"
distance="0.15052764594854906"/>
<segment
sequence="8"
instruction="Take EXIT 32A toward LOWELL"
distance="0.032767910543403965"/>
<segment
sequence="9"
instruction="Stay STRAIGHT to go onto RAMP (Going East)"
distance="0.27877937515534706"/>
<segment
sequence="10"
instruction="Turn LEFT onto US3 (Going Northwest)"
distance="20.66104112133381"/>
<segment
sequence="11"
instruction="Stay STRAIGHT to go onto FREDERICK E EVERETT
TPKE/US3 (Going Northwest)"
distance="0.00588619663828994"/>
<segment
sequence="12"
instruction="Take EXIT 1 toward SO NASHUA"
distance="0.5504892461007892"/>
<segment
sequence="13"
instruction="Turn LEFT onto SPIT BROOK RD (Going West)"
distance="0.5032054891878457"/>
<segment
sequence="14"
instruction="Turn RIGHT onto ORACLE DR (Going North)"
distance="0.3275097635011146"/>
</route>
</route_response>
Example C3 shows a request for the fastest route, preferably using highways, between two locations specified as longitude/latitude points, with driving directions for each segment, and using meters for distances and seconds for times. (The points are associated with two locations in San Francisco, California: the World Trade Center and 100 Flower Street.)
Example C3 Route Request with Specified Longitude/Latitude Points
<?xml version="1.0" standalone="yes"?>
<route_request id="8"
route_preference="shortest"
road_preference="highway"
return_driving_directions="true"
distance_unit="meter"
time_unit="second"
return_route_geometry="true"
>
<start_location>
<input_location id="1" longitude="122.39382" latitude="37.79518" />
</start_location>
<end_location>
<input_location id="2" longitude="122.4054826" latitude="37.7423566" />
</end_location>
</route_request>
Example C4 shows the response generated by the request in Example C3. (The output is reformatted for readability.)
Example C4 Route Response with Specified Longitude/Latitude Points
<route_response>
<route id="8" step_count="13" distance="7261.4423828125" distance_unit="meter"
time="441.9170837402344" time_unit="second">
<route_geometry>
<LineString>
<coordinates>
122.39381999996483,37.79517999996185 122.39382,37.79518 122.39458,37.79598 122.39469,37.796
122.39474,37.796 122.39479,37.79599 122.39483,37.79591 122.39483,37.79579 122.39462,37.79539
122.39424,37.79488 122.39338,37.79434 122.39311,37.79413 122.39275,37.79384 122.39258,37.79368
122.39171,37.79297 122.39145,37.79273 122.39127,37.79248 122.3912,37.79235 122.39107,37.79208
122.39098,37.79185 122.39088,37.79161 122.39075,37.79138 122.39048,37.79105 122.3901,37.79079
122.38918,37.79001 122.38877,37.78968 122.38857,37.78948 122.38939,37.78882 122.39024,37.78815
122.39113,37.78745 122.39192,37.7868 122.39284,37.78606 122.39372,37.78535 122.39406,37.78507
122.39511,37.78426 122.39565,37.78383 122.39621,37.78337 122.39728,37.78252 122.39824,37.78177
122.39955,37.78075 122.39963,37.78032 122.3997,37.78011 122.39984,37.77991 122.40071,37.77899
122.40085,37.77888 122.40129,37.77855 122.40182,37.77815 122.40245,37.77776 122.40302,37.77737
122.40375,37.77695 122.40433,37.77657 122.40529,37.77592 122.40581,37.7755 122.40605,37.77524
122.4063,37.77493 122.40656,37.7744 122.40671,37.7739 122.40683,37.77312 122.40671,37.77264
122.4066,37.77216 122.40634,37.77151 122.40594,37.77074 122.40573,37.77022 122.4055,37.76958
122.40547,37.76913 122.40541,37.76843 122.40542,37.76791 122.40547,37.76743 122.40541,37.76715
122.40526,37.76579 122.4051,37.7645 122.40513,37.76404 122.40519,37.76356 122.40544,37.7629 122.40561,37.76257 122.40586,37.76218 122.40619,37.76161 122.40636,37.7612 122.40648,37.76063
122.40642,37.75996 122.40633,37.75965 122.4061,37.75918 122.40574,37.75875 122.40543,37.75846
122.4045,37.75778 122.40402,37.75735 122.4038,37.75712 122.40365,37.75688 122.40344,37.75645
122.4033,37.75588 122.40326,37.75537 122.40316,37.75437 122.40304,37.75256 122.40376,37.7502
122.40384,37.74976 122.40396,37.74969 122.40454,37.74947 122.40468,37.74933 122.40474,37.74921
122.40471,37.74902 122.4045,37.74873 122.40417,37.74839 122.404,37.7482 122.40378,37.74799
122.40376,37.74781 122.40428,37.74623 122.40428,37.74598 122.40417,37.74557 122.40419,37.74483
122.40431,37.74423 122.40443,37.74396 122.40468,37.74353 122.40509,37.74294 122.40472,37.74274
122.40512,37.7422 122.40548260000706,37.74235680000305
</coordinates>
</LineString>
</route_geometry>
<segment sequence="1" instruction="Start out on THE EMBARCADERO (Going
Northwest)" distance="5.246016371529549E6"/>
<segment sequence="2" instruction="Stay STRAIGHT to go onto THE
EMBARCADERO/WORLD TRADE CTR/FERRY PLZ/FERRY
BLDG (Going Northwest)" distance="111.19815063476562"/>
<segment sequence="3" instruction="Turn LEFT onto RAMP (Going Southwest)"
distance="41.756561279296875"/>
<segment sequence="4" instruction="Turn LEFT onto THE EMBARCADERO (Going
Southeast)" distance="905.924072265625"/>
<segment sequence="5" instruction="Turn RIGHT onto HARRISON ST (Going
Southwest)" distance="1369.1490478515625"/>
<segment sequence="6" instruction="Take I80 W RAMP toward SAN JOSE"
distance="225.425048828125"/>
<segment sequence="7" instruction="Turn SLIGHT RIGHT onto I80/JAMES LICK
SKWY (Going Southwest)" distance="1528.181396484375"/>
<segment sequence="8" instruction="Stay STRAIGHT to go onto
US101/JAMES LICK FWY (Going South)" distance="1765.10498046875"/>
<segment sequence="9" instruction="Turn SLIGHT RIGHT onto RAMP (Going
South)" distance="481.18505859375"/>
<segment sequence="10" instruction="Turn LEFT onto BAY SHORE BLVD (Going
Southeast)" distance="688.142578125"/>
<segment sequence="11" instruction="Turn LEFT onto OAKDALE AVE (Going
Southeast)" distance="39.44921875"/>
<segment sequence="12" instruction="Turn RIGHT onto PATTERSON ST (Going
Southwest)" distance="69.53564453125"/>
<segment sequence="13" instruction="Turn RIGHT onto FLOWER ST (Going
Northwest)" distance="36.39051818847656"/>
</route>
</route_response>
Example C5 shows a request for the route, with driving directions, where the start and end locations are previously geocoded locations that are about onehalf mile apart in Boston, Massachusetts.
Example C5 Route Request with Previously Geocoded Locations
<?xml version="1.0" standalone="yes"?>
<route_request id="8"
route_preference="shortest"
road_preference="highway"
return_driving_directions="true"
distance_unit="mile"
time_unit="minute"
pre_geocoded_locations="true">
<start_location>
<pre_geocoded_location id="1">
<edge_id>22161661</edge_id>
<percent>.5</percent>
<side>L</side>
</pre_geocoded_location>
</start_location>
<end_location>
<pre_geocoded_location id="2">
<edge_id>22104391</edge_id>
<percent>.5</percent>
<side>R</side>
</pre_geocoded_location>
</end_location>
</route_request>
Example C6 shows the response to the request in Example C5. (The output is reformatted for readability.)
Example C6 Route Response with Previously Geocoded Locations
<?xml version="1.0" ?>
<route_response>
<route
id="8"
step_count="5"
distance="0.5848966065287509"
distance_unit="mile"
time="1.1866167704264323"
time_unit="minute">
<segment
sequence="1"
instruction="Start out on HUNTINGTON AVE (Going Southeast)"
distance="0.005477076104790563" />
<segment
sequence="2"
instruction="Turn LEFT onto AVENUE OF THE ARTS/HUNTINGTON
AVE/RT9 (Going Northeast)"
distance="0.006677015642704102" />
<segment
sequence="3"
instruction="Turn RIGHT onto PUBLIC ALLEY 405 (Going Southeast)"
distance="0.05267257088346108" />
<segment
sequence="4"
instruction="Turn RIGHT onto ST BOTOLPH ST (Going Southwest)"
distance="0.010097520017923165" />
<segment
sequence="5"
instruction="Turn RIGHT onto MASSACHUSETTS AVE (Going Northwest)"
distance="0.5099724250650759" />
</route>
</route_response>
C.2.2 Route Request DTD
The following is the complete DTD for a route request. The main elements and attributes of the DTD are explained in sections that follow.
<?xml version="1.0" encoding="UTF8"?>
<! geocoder.dtd includes gmlfeature.dtd. These define the
ELEMENTS input_address and those in Feature, FeatureMember,
and FeatureCollection that are used in geoFeature,
geoFeatureCollection, and geoFeatureMember.
>
<!ENTITY % GEOCODERDTD SYSTEM "geocoder.dtd">
%GEOCODERDTD;
<!
input_location element is defined in geocoder.dtd.
GeometryClasses is defined in gmlgeometry.dtd.
>
<!ELEMENT route_request (start_location, end_location)>
<!ATTLIST route_request
vendor CDATA "Oracle"
id CDATA #REQUIRED
route_preference (FASTESTSHORTEST) #IMPLIED
road_preference (HIGHWAYLOCAL) #IMPLIED
return_driving_directions (TRUEFALSE) #IMPLIED
return_hierarchival_driving_directions (TRUEFALSE) #IMPLIED
return_route_geometry (TRUEFALSE) #IMPLIED
return_detailed_geometries (TRUEFALSE) #IMPLIED
return_segment_geometry (TRUEFALSE) #IMPLIED
language CDATA #IMPLIED
distance_unit (KMMILEMETER) #IMPLIED
time_unit (HOURMINUTESECOND) #IMPLIED>
<! Following are alternatives for specifying the location. Use
input_location when you want to represent a location with a
street address. Use longitude_latitude_location when you want to
specify a location by longitude and latitude coordinates.
If you have already geocoded the location,
you can use information from the geocoder response to
construct a pre_geocoded_location element.
The geocoder returns:
 An edge_id (integer that is the road segment identifier)
 A side ('L' or 'R' – left or right side)
 A percent (floatingpoint number 0.0 to 1.0 representing
the fraction of the length from the start of the road
segment to this location.
>
<!ELEMENT pre_geocoded_location (edge_id, percent, side)>
<!ATTLIST pre_geocoded_location id CDATA #REQUIRED>
<!ELEMENT longitude_latitude_location (longitude, latitude)>
<!ELEMENT start_location (input_locationpre_geocoded_locationlongitude_latitude_location)>
<!ELEMENT end_location (input_locationpre_geocoded_locationlongitude_latitude_location)>
C.2.2.1 route_request Element
The <route_request>
element has the following definition:
<!ELEMENT route_request (start_location, end_location)>
The root element of a route request is always named route_request
.
The <start_location>
child element specifies the start location for the route, as an address specification, a geocoded address, or longitude/latitude coordinates.
The <end_location>
child element specifies the end location for the route, as an address specification, a geocoded address, or longitude/latitude coordinates.
C.2.2.2 route_request Attributes
The root element <route_request>
has a number of attributes, most of them optional. The attributes are defined as follows:
<!ATTLIST route_request
vendor CDATA "Oracle"
id CDATA #REQUIRED
route_preference (FASTESTSHORTEST) #IMPLIED
road_preference (HIGHWAYLOCAL) #IMPLIED
return_driving_directions (TRUEFALSE) #IMPLIED
return_route_geometry (TRUEFALSE) #IMPLIED
return_segment_geometry (TRUEFALSE) #IMPLIED
language CDATA #IMPLIED
distance_unit (KMMILEMETER) #IMPLIED
time_unit (HOURMINUTESECOND) #IMPLIED
pre_geocoded_locations (TRUEFALSE) #IMPLIED
return_hierarchical_driving_directions (TRUEFALSE) #IMPLIED
return_detailed_geometries (TRUEFALSE) #IMPLIED>
vendor
is an optional attribute whose default value identifies the routing provider as Oracle.
id
is a required attribute that specifies an identification number to be associated with the request.
route_preference
is an optional attribute that specifies whether you want the route with the lowest estimated driving time (FASTEST
) or the route with the shortest driving distance (SHORTEST
, the default).
road_preference
is an optional attribute that specifies whether you want the route to use highways (HIGHWAY
, the default) or local roads (LOCAL
) when a choice is available.
return_driving_directions
is an optional attribute that specifies whether you want driving directions for the route. TRUE
(the default) returns driving directions; FALSE
does not return driving directions.
return_route_geometry
is an optional attribute that specifies whether you want the coordinates of the line string that represents the route. TRUE
returns the coordinates; FALSE
(the default) does not return the coordinates.
return_segment_geometry
is currently ignored.
language
is currently ignored.
distance_unit
is an optional attribute that specifies the unit of measure for distance values that are returned: KM
for kilometer, MILE
(the default) for mile, or METER
for meter.
time_unit
is an optional attribute that specifies the unit for time values that are returned: HOUR
for hour, MINUTE
(the default) for minute, or SECOND
for second.
pre_geocoded_locations
is an optional attribute that indicates how the start and end locations are specified. TRUE
means that both are previously geocoded locations specified using the <pre_geocoded_location>
element; FALSE
(the default) means that both are addresses specified using the <input_address>
or <longitude_latitude_location>
element.
return_hierarchical_driving_directions
is an optional attribute that whether to return the driving directions as an expandable and collapsible hierarchy or as a list with no hierarchy. TRUE
means to return a hierarchy; FALSE
(the default) means to return a list with no hierarchy.
return_detailed_geometries
is an optional attribute that indicates the level of detail to be included in returned geometries. TRUE
(the default) returns detailed geometries; FALSE
returns generalized geometries (and usually smaller).
C.2.2.3 input_location Element
The <input_location>
element specifies an address in a format that satisfies the Oracle Spatial geocoding request DTD, which is described in Section C.2.7.1. You can specify the input location using either the <Point>
element or the <input_address>
element. Example C1 in Section C.2.1 shows the start and end addresses specified using the <input_location>
element and its child element <input_address>
.
To use the <input_location>
element, you must ensure that the value of the pre_geocoded_locations
attribute is FALSE
(the default) in the <route_request>
element. To specify the start location and the end location, you can use the <input_location>
element for both, the <longitude_latitude_location>
element (described in Section C.2.2.5) for both, or the <input_location>
element for one and the <longitude_latitude_location>
element for the other.
C.2.2.4 pre_geocoded_location Element
The <pre_geocoded_location>
element specifies a geocoded location in terms of how far along a street (an edge) the address is and on which side of the street. Example C5 in Section C.2.1 shows the start and end addresses specified using the <pre_geocoded_location>
element.
To use the <pre_geocoded_location>
element, you must specify pre_geocoded_locations="TRUE"
in the <route_request>
element, and you must use the <pre_geocoded_location>
element to specify both the start and end locations.
C.2.2.5 longitude_latitude_location Element
The <longitude_latitude_location>
element specifies longitude and latitude coordinates for the location.
To use the <longitude_latitude_location>
element, you must ensure that the value of the pre_geocoded_locations
attribute is FALSE
(the default) in the <route_request>
element. To specify the start location and the end location, you can use the <input_location>
element (described in Section C.2.2.3) for both, the <longitude_latitude_location>
element for both, or the <input_location>
element for one and the <longitude_latitude_location>
element for the other.
C.2.3 Route Response DTD
The following is the complete DTD for a route response:
<?xml version="1.0" encoding="UTF8"?>
<! route_response DTD includes the gmlgeometry DTD
as an external entity reference.
>
<!ENTITY % GMLGEOMETRYDTD SYSTEM "gmlgeometry.dtd">
%GMLGEOMETRYDTD;
<!ELEMENT route_response (route  router_error)>
<!ELEMENT route (route_geometry?, segment+)>
<!ATTLIST route id CDATA #REQUIRED
step_count CDATA #IMPLIED
time CDATA #IMPLIED
distance CDATA #IMPLIED>
<!ELEMENT router_error EMPTY>
<!ATTLIST router_error
id CDATA #REQUIRED
error_code CDATA #IMPLIED
error_msg CDATA #IMPLIED>
<!ELEMENT route_geometry (LineString  MultiLineString)?>
<!ELEMENT segment segment*, (LineString  MultiLineString)?>
<!ATTLIST segment sequence CDATA #REQUIRED
instruction CDATA #IMPLIED
distance CDATA #IMPLIED>
C.2.4 Batch Route Request and Response Examples
This section contains XML examples of batch route requests and the responses generated by those requests. One request uses specified addresses, and the other request uses previously geocoded locations. For reference information about the available elements and attributes, see Section C.2.5 for requests and Section C.2.6 for responses.
Example C7 shows a batch route request using specified addresses. The request is for the fastest routes, preferably using highways, between an office in Waltham, Massachusetts and three end locations (an Oracle office in Nashua, New Hampshire; the town offices in Concord, Massachusetts; and Boston City Hall), using miles for distances and minutes for times. The request calls for the returned routes to be sorted by distance between the start and end location, and for no routes over 35 miles to be returned.
Example C7 Batch Route Request with Specified Addresses
<?xml version="1.0" standalone="yes"?>
<batch_route_request
id="8"
route_preference="fastest"
road_preference="highway"
return_driving_directions="false"
sort_by_distance = "true"
cutoff_distance="35"
distance_unit="mile"
time_unit="minute">
<start_location>
<input_location
id="1">
<input_address>
<us_form1
street="1000 Winter St"
lastline="Waltham, MA" />
</input_address>
</input_location>
</start_location>
<end_location>
<input_location id="10">
<input_address>
<us_form1
street="1 Oracle Dr"
lastline="Nashua, NH" />
</input_address>
</input_location>
</end_location>
<end_location>
<input_location
id="11">
<input_address>
<us_form1
street="22 Monument Sq"
lastline="Concord, MA" />
</input_address>
</input_location>
</end_location>
<end_location>
<input_location
id="12">
<input_address>
<us_form1
street="1 City Hall Plaza"
lastline="Boston, MA" />
</input_address>
</input_location>
</end_location>
</batch_route_request>
Example C8 shows the response generated by the request in Example C7. (The output is reformatted for readability.)
Example C8 Batch Route Response with Specified Addresses
<?xml version="1.0" standalone="yes" ?>
<batch_route_response
id="8">
<route
id="11"
step_count="0"
distance="9.132561517429938"
distance_unit="mile"
time="12.4705078125"
time_unit="minute" />
<route
id="12"
step_count="0"
distance="17.74747391140558"
distance_unit="mile"
time="20.413236490885417"
time_unit="minute" />
<route
id="10"
step_count="0"
distance="30.28667355371901"
distance_unit="mile"
time="35.02037760416667"
time_unit="minute" />
</batch_route_response>
Example C9 shows a batch route request using previously geocoded locations. The request is for the shortest routes, preferably using highways, between one location and three other locations, using miles for distances and minutes for times. The request calls for the returned routes to be sorted by distance between the start and end location, and for no routes over 50 miles to be returned.
Example C9 Batch Route Request with Previously Geocoded Locations
<?xml version="1.0" standalone="yes"?>
<batch_route_request id="8"
route_preference="shortest"
road_preference="highway"
return_driving_directions="false"
distance_unit="mile"
time_unit="minute"
pre_geocoded_locations="true"
cutoff_distance="50"
sort_by_distance="true">
<start_location>
<pre_geocoded_location id="1">
<edge_id>22161661</edge_id>
<percent>.5</percent>
<side>L</side>
</pre_geocoded_location>
</start_location>
<end_location>
<pre_geocoded_location id="2">
<edge_id>22104391</edge_id>
<percent>.5</percent>
<side>R</side>
</pre_geocoded_location>
</end_location>
<end_location>
<pre_geocoded_location id="3">
<edge_id>22160808</edge_id>
<percent>.5</percent>
<side>L</side>
</pre_geocoded_location>
</end_location>
<end_location>
<pre_geocoded_location id="4">
<edge_id>22325991</edge_id>
<percent>.5</percent>
<side>R</side>
</pre_geocoded_location>
</end_location>
</batch_route_request>
Example C10 shows the response to the request in Example C9. Only two routes are returned, because the third route is longer than the specified cutoff distance of 50 miles. (The output is reformatted for readability.)
Example C10 Batch Route Response with Previously Geocoded Locations
<?xml version="1.0" standalone="yes" ?>
<batch_route_response id="8">
<route
id="2"
step_count="0"
distance="0.5848966065287509"
distance_unit="mile"
time="1.1866167704264323"
time_unit="minute" />
<route
id="4"
step_count="0"
distance="41.09054596719071"
distance_unit="mile"
time="45.4477294921875"
time_unit="minute" />
</batch_route_response>
C.2.5 Batch Route Request DTD
The following is the complete DTD for a batch route request. The main elements and attributes of the DTD are explained in sections that follow.
<!ENTITY % GEOCODERDTD SYSTEM "geocoder.dtd">
%GEOCODERDTD;
<! input_location element is defined in geocoder.dtd >
<!ELEMENT batch_route_request (start_location, end_location+)>
<!ATTLIST batch_route_request
vendor CDATA "Oracle"
id CDATA #REQUIRED
route_preference (FASTEST  SHORTEST ) #IMPLIED
road_preference (HIGHWAY  LOCAL) #IMPLIED
distance_unit (KM  MILE  METER ) #IMPLIED
time_unit (HOUR  MINUTE  SECOND) #IMPLIED
sort_by_distance (TRUE  FALSE) #IMPLIED
cutoff_distance CDATA #IMPLIED>
<! Following are alternatives for specifying the location. Use
input_location when you want to represent a location with a
street address. Use longitude_latitude_location when you want to
specify a location by longitude and latitude coordinates.
If you have already geocoded the location,
you can use information from the geocoder response to
construct a pre_geocoded_location element.
The geocoder returns:
 an edge_id (integer that is the road segment identifier)
 a side ('L' or 'R' – left or right side)
 a percent (floatingpoint number 0.0 to 1.0 representing
the fraction of the length from the start of the road
segment to this location.
>
<!ELEMENT pre_geocoded_location (edge_id, percent, side)>
<!ATTLIST pre_geocoded_location id CDATA #REQUIRED>
<!ELEMENT longitude_latitude_location (longitude, latitude)>
<!ELEMENT start_location (input_locationpre_geocoded_locationlongitude_latitude_location)>
<!ELEMENT end_location (input_locationpre_geocoded_locationlongitude_latitude_location)>
<! IMPORTANT VALIDITY CONSTRAINT: each of the input_location
elements that are children of end_location MUST contain
the id attribute. Normally, the id attribute is optional.
If an id is not present, an exception will result.
Also, each id must be unique within a batch_route_request.
Otherwise, the request will yield unpredictable results.
>
C.2.5.1 batch_route_request Element
The <batch_route_request>
element has the following definition:
<!ELEMENT batch_route_request (start_location, end_location+)>
The root element of a route request is always named batch_route_request
.
The <start_location>
child element specifies the start location for the route, as an address specification, a geocoded address, or longitude/latitude coordinates.
Each of the one or more <end_location>
child elements specifies the end location for the route, as an address specification, a geocoded address, or longitude/latitude coordinates.
C.2.5.2 batch_route_request Attributes
The root element <batch_route_request>
has a number of attributes, most of them optional. The attributes are defined as follows:
<!ATTLIST batch_route_request
vendor CDATA "Oracle"
id CDATA #REQUIRED
route_preference (FASTESTSHORTEST) #IMPLIED
road_preference (HIGHWAYLOCAL) #IMPLIED
distance_unit (KMMILEMETER) #IMPLIED
time_unit (HOURMINUTESECOND) #IMPLIED
sort_by_distance (TRUE  FALSE) #IMPLIED
cutoff_distance CDATA #IMPLIED>
pre_geocoded_locations (TRUEFALSE) #IMPLIED>
Most <batch_route_request>
attributes have the same meaning as their counterpart <route_request>
attributes, which are explained in Section C.2.5.2. In addition, the sort_by_distance
and cutoff_distance
attributes do not apply to single route requests.
sort_by_distance
is an optional attribute that specifies whether you want the routes returned in ascending order by distance of the end location from the start location. TRUE
sorts the returned routes by distance; FALSE
(the default) does not sort the returned routes by distance.
cutoff_distance
is an optional attribute that causes routes to be returned only where the end location is less than or equal to a specified distance from the start location. By default, all routes are returned.
Note:
If a route is within the specified cutoff_distance value but would generate a <router_error> element in the response (see Section C.2.6), the route is removed from the response and not shown. 
C.2.6 Batch Route Response DTD
The following is the complete DTD for a batch route response:
<?xml version="1.0" encoding="UTF8"?>
<!ELEMENT batch_route_response (route  route_error)+ >
<!ATTLIST batch_route_response id CDATA #REQUIRED>
<!ELEMENT route EMPTY>
<!ATTLIST route
id CDATA #REQUIRED
step_count CDATA #IMPLIED
distance CDATA #IMPLIED
distance_unit CDATA #IMPLIED
time CDATA #IMPLIED
time_unit CDATA #IMPLIED>
<!ELEMENT router_error EMPTY>
<!ATTLIST router_error
id CDATA #REQUIRED
error_code CDATA #IMPLIED
error_msg CDATA #IMPLIED>
C.2.7 Geocoding Request and Response DTDs
This section presents the DTDs for requests to geocode an address and for responses to these requests. These DTDs are supported only for use with route requests, and they are not explained in detail.
C.2.7.1 Geocoding Request DTD
The DTD for a request to geocode an address is as follows:
<! geocode_request DTD includes the GML Feature
DTD as an external entity reference. The complete
URL for the DTD is:
http://www.opengis.org/techno/specs/00029/gmlfeature.dtd
>
<!ENTITY % GMLFEATUREDTD SYSTEM "gmlfeature.dtd">
%GMLFEATUREDTD;
<!ELEMENT geocode_request (address_list)>
<!ATTLIST geocode_request >
<!ELEMENT address_list (input_location+)>
<!ELEMENT input_location (Point  input_address)>
<!ATTLIST input_location
id CDATA #IMPLIED
multimatch_number CDATA "4">
<!ELEMENT Point EMPTY>
<!ATTLIST Point
longitude CDATA #IMPLIED
latitude CDATA #IMPLIED
>
<!ELEMENT input_address (us_form1  us_form2  gdf_form  gen_form  unformatted)>
<!ATTLIST input_address match_mode CDATA #IMPLIED >
<!ELEMENT gdf_form EMPTY>
<!ATTLIST gdf_form
name CDATA #IMPLIED
street CDATA #IMPLIED
intersecting_street CDATA #IMPLIED
builtup_area CDATA #IMPLIED
order8_area CDATA #IMPLIED
order2_area CDATA #IMPLIED
order1_area CDATA #IMPLIED
country CDATA #IMPLIED
postal_code CDATA #IMPLIED
postal_addon_code CDATA #IMPLIED>
<!ELEMENT gen_form EMPTY>
<!ATTLIST gen_form
name CDATA #IMPLIED
street CDATA #IMPLIED
intersecting_street CDATA #IMPLIED
sub_area CDATA #IMPLIED
city CDATA #IMPLIED
region CDATA #IMPLIED
country CDATA #IMPLIED
postal_code CDATA #IMPLIED
postal_addon_code CDATA #IMPLIED>
<!ELEMENT us_form1 EMPTY>
<!ATTLIST us_form1
name CDATA #IMPLIED
street CDATA #IMPLIED
intersecting_street CDATA #IMPLIED
lastline CDATA #IMPLIED>
<!ELEMENT us_form2 EMPTY>
<!ATTLIST us_form2
name CDATA #IMPLIED
street CDATA #IMPLIED
intersecting_street CDATA #IMPLIED
city CDATA #IMPLIED
state CDATA #IMPLIED
zip_code CDATA #IMPLIED>
<!ELEMENT unformatted (address_line) >
<!ATTLIST unformatted country CDATA #IMPLIED >
<!ELEMENT address_line EMPTY >
<!ATTLIST value #REQUIRED >
C.2.7.2 Geocoding Response DTD
The DTD for a response generated by a request to geocode an address is as follows:
<?xml version="1.0" encoding="UTF8"?>
<!ELEMENT geocode_response (geocode+)>
<!ELEMENT geocode (match*)>
<!ATTLIST geocode id CDATA #REQUIRED
match_count CDATA #IMPLIED
>
<!ELEMENT match (output_address)>
<!ATTLIST match sequence CDATA #REQUIRED
longitude CDATA #REQUIRED
latitude CDATA #REQUIRED
match_code CDATA #REQUIRED
error_message CDATA #IMPLIED >
<!ELEMENT output_address EMPTY>
<!ATTLIST output_address
name CDATA #IMPLIED
house_number CDATA #IMPLIED
street CDATA #IMPLIED
builtup_area CDATA #IMPLIED
order1_area CDATA #IMPLIED
order8_area CDATA #IMPLIED
country CDATA #IMPLIED
postal_code CDATA #IMPLIED
postal_addon_code CDATA #IMPLIED
side CDATA #IMPLIED
percent CDATA #IMPLIED
edge_id CDATA #IMPLIED>
C.3 Data Structures Used by the Routing Engine
Each database user of the routing engine must have the following tables is its schema:

EDGE

NODE

PARTITION

SIGN_POST
The EDGE and NODE tables store edge and node information about the street network used by the routing engine. To understand how edges and nodes are used to represent street segments, intersections, and other entities in a street network, you must be familiar with the Oracle Spatial network data model, which is described in Oracle Spatial Topology and Network Data Models.
The following sections describe the tables used by the routing engine, in alphabetical order by table name.
C.3.1 EDGE Table
The EDGE table contains one row for each directed edge in a street network. Each street segment (a part of a road between two nodes) is an undirected edge that corresponds to one or more directed edges in the EDGE table. The EDGE table contains the columns shown in Table C1.
C.3.2 NODE Table
The NODE table contains one row for each node that is the start node or end node of one or more edges in the street network. A node often corresponds to an intersection (the intersection of two edges); however, a node can be independent of any intersection (for example, the end of a "dead end" or "no outlet" street). The NODE table contains the columns shown in Table C2.
C.3.3 PARTITION Table
The PARTITION table is generated by Oracle based on the contents of the EDGE and NODE tables. (If the contents of the EDGE or NODE table, or both tables, change, you can call the SDO_ROUTER_PARTITION.PARTITION_ROUTER PL/SQL procedure to partition the data, and then swap the new partition table for the existing partition table.) The PARTITION table contains the columns shown in Table C3.
C.3.4 SIGN_POST Table
The SIGN_POST table stores sign information that is used to generate driving directions. For example, a sign might indicate that Exit 33A on US Route 3 South goes toward Winchester. A SIGN_POST row might correspond to a physical sign at an exit ramp on a highway, but it does not need to correspond to a physical sign.