Oracle8i Spatial User's Guide and Reference
Release 8.1.5

A67295-01

Library

Product

Contents

Index

Prev Next

15
Geometry Functions and Procedures

This chapter contains descriptions of the geometric functions and procedures shown in Table 15-1.

Table 15-1 Geometric Functions and Procedures
Function/Procedure  Description 

SDO_GEOM.RELATE  

Determines how two objects interact.  

SDO_GEOM.VALIDATE_GEOM  

Determines if a geometry is valid.  

SDO_GEOM.VALIDATE_LAYER  

Determines if all geometries in a layer are valid.  

This chapter refers to the relational Spatial model only.


SDO_GEOM.RELATE

Purpose

This function examines two geometry objects to determine their spatial relationship. It is available in two forms. See the Usage Notes for more information.

Syntax

SDO_GEOM.RELATE (layername1, SDO_GID1, mask, [layername2,] SDO_GID2)

SDO_GEOM.RELATE (layername1, SDO_GID1, mask, X_tolerance, Y_tolerance,
SDO_ETYPE, num_ordinates, X_ordinate1, Y_ordinate1 [,...,Xn, Yn]
[,SDO_ETYPE, num_ordinates, X_ordinate1, Y_ordinate1 [,...,Xn, Yn]])

Keywords and Parameters

layername1,
layername2
 

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry and spatial index tables.
Data type is VARCHAR2.  

SDO_GID1,
SDO_GID2
 

Specifies the geometry object identifier.
Data type is NUMBER.  

mask  

Specifies a list of relationships to check. See the list of keywords in the Usage Notes.  

X_tolerance,

Y_tolerance  

Specifies the distance two points can be apart and still be considered the same due to rounding errors. Tolerance must be greater than zero. If you want zero tolerance, enter a number such as 0.000005, where the number of zeros to the right of the decimal point matches the precision of your data.
Data type is NUMBER.  

SDO_ETYPE  

Specifies the type of geometry element.
Data type is INTEGER, corresponding to the following constants:

1 SDO_GEOM.POINT_TYPE

2 SDO_GEOM.LINESTRING_TYPE

3 SDO_GEOM.POLYGON_TYPE  

num_ordinates  

Specifies the number of ordinates for this element. Data type is NUMBER.  

X_ordinateN,

Y_ordinateN  

Specifies the X and Y values of a vertex (coordinate pair) in a geometry.
Data type is NUMBER.  

Returns

The SDO_GEOM.RELATE() function can return three types of answers:

  1. If you pass a mask listing one or more relationships, the function returns the name of the relationship if it is true for the pair of geometries. If all of the relationships are false, the function returns FALSE.

  2. If you pass the DETERMINE keyword in the mask, the function returns the one relationship keyword that best matches the geometries. DETERMINE can only be used when SDO_GEOM.RELATE() is in the SELECT clause of the SQL statement.

  3. If you pass the ANYINTERACT keyword in the mask, the function returns TRUE if the two geometries are not disjoint.

The data type is VARCHAR2.

Usage Notes

Use the first form of the function to examine two stored geometric objects.

Use the second form of the function to compare a stored object against a user-defined object. You can specify up to 123 vertices for a single-element geometry. If the geometry has multiple elements, the total number of arguments passed, including SDO_ETYPE, num_ordinates, and the list of vertex coordinates, cannot exceed 255 values.

The following relationships can be tested:

Mask values can be combined using the logical Boolean operator OR. For example, `INSIDE + TOUCH' returns either 'INSIDE', 'TOUCH', or 'FALSE' depending on the outcome of the test.

Related Topics

None.


SDO_GEOM.VALIDATE_GEOM

Purpose

This function provides a consistency check for valid geometry types. The function checks the representation of the geometry from the tables against the element definitions.

Syntax

SDO_GEOM.VALIDATE_GEOM (layername,SDO_GID)

Keywords and Parameters

layername  

Specifies the name of the data set layer. The layer name is used to construct the name of the geometry and spatial index tables.
Data type is VARCHAR2.  

SDO_GID  

Specifies the geometric object identifier.
Data type is NUMBER.  

Returns

This function returns one of the following:

The data type is VARCHAR2.

Usage Notes

This function checks for the following:

Related Topics

None.


SDO_GEOM.VALIDATE_LAYER

Purpose

This function examines a layer to determine if the stored geometries follow the defined rules for geometric objects.

Syntax

SDO_GEOM.VALIDATE_LAYER (layername, result_table)

Keywords and Parameters

layername  

Specifies the name of the layer to examine.
Data type is VARCHAR2.  

result_table  

Specifies the name of the result table.
Data type is VARCHAR2.  

Returns

This function fills the result table with validation results.

Usage Notes

Create an empty result table prior to calling this function. The format of the result table is: (sdo_gid number, result varchar2).

This function checks for the following:

Related Topics

None.




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index