25.20 SDO_GEOM.SDO_MAXDISTANCE_LINE
Note:
This feature is available starting with Oracle Database 12c Release 1 (12.1.0.2).
Format
SDO_GEOM.SDO_MAXDISTANCE_LINE( geom1 IN SDO_GEOMETRY, dim1 IN SDO_DIM_ARRAY, geom2 IN SDO_GEOMETRY, dim2 IN SDO_DIM_ARRAY ) RETURN SDO_GEOMETRY;
or
SDO_GEOM.SDO_MAXDISTANCE_LINE( geom1 IN SDO_GEOMETRY, geom2 IN SDO_GEOMETRY, tol IN NUMBER ) RETURN SDO_GEOMETRY;
Description
Computes the maximum distance between two geometry objects, and returns the line string geometry reflecting the maximum distance. The maximum distance between two geometry objects is the distance between the farthest pair of points or segments of the two objects. The returned geometry is a straight line between this farthest pair of points or segments.
Parameters
- geom1
-
Geometry object whose distance from
geom2
is to be computed. - dim1
-
Dimensional information array corresponding to
geom1
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Geometry Metadata Views). - geom2
-
Geometry object whose distance from
geom1
is to be computed. - dim2
-
Dimensional information array corresponding to
geom2
, usually selected from one of the xxx_SDO_GEOM_METADATA views (described in Geometry Metadata Views). - tol
-
Tolerance value (see Tolerance).
Usage Notes
An exception is raised if geom1
and geom2
are based on different coordinate systems.
The input geometries can have no more than two dimensions.
Examples
The following example returns the line string reflecting the maximum distance between cola_b
and cola_d
. (The example uses the definitions and data from Simple Example: Inserting_ Indexing_ and Querying Spatial Data.)
SELECT SDO_GEOM.SDO_MAXDISTANCE_LINE(c_b.shape, c_d.shape, 0.005) FROM cola_markets c_b, cola_markets c_d WHERE c_b.name = 'cola_b' AND c_d.name = 'cola_d'; SDO_GEOM.SDO_MAXDISTANCE_LINE(C_B.SHAPE,C_D.SHAPE,0.005)(SDO_GTYPE, SDO_SRID, SD -------------------------------------------------------------------------------- SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY( 5, 1, 8.70224688, 10.8726584))
Parent topic: SDO_GEOM Package (Geometry)