Oracle7 Spatial Data Option User's Guide and Reference Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index



Go to previous file in sequence Go to next file in sequence

Geometry Functions



This chapter contains descriptions of the following geometric functions and procedures:

Table 6¯1 Geometric Functions:

Function Description
SDO_GEOM.ADD_NODES

Stores points in the geometry table.

SDO_GEOM.INIT_ELEMENT

Initializes space in the geometry table for a new object.

SDO_GEOM.INTERACT

Determines if two objects are disjoint.

SDO_GEOM.RELATE

Determines how two objects interact.

SDO_GEOM.VALIDATE_GEOMETRY

Determines if a geometry is legal.

SDO_GEOM.ADD_NODES

Purpose

This procedure stores coordinate geometry points into the SDOGEOM table.

Syntax

SDO_GEOM.ADD_NODES (layername, SDO_GID, SDO_ESEQ, SDO_ETYPE, X-ord1,Y-ord1[,...,X125, Y125])

Keywords and Parameters
layername

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

SDO_GID

Specifies the unique geometric object identifier. Datatype is NUMBER.

SDO_ESEQ

Specifies the element sequence number. The eseq is unique within an SDO_GID. Datatype is NUMBER.

SDO_ETYPE

Specifies the type of geometric element. Datatype is INTEGER, corresponding to the following constants:

1 SDO_GEOM.POINT_TYPE

2 SDO_GEOM.LINESTRING_TYPE

3 SDO_GEOM.POLYGON_TYPE

X ordinateN,

Y ordinateN

Specifies the X and Y values of a vertex (coordinate pair) in a geometry. Up to 125 pairs may be added in a single call. Datatype is NUMBER.

Returns

None

Usage Notes

Example 6¯1

Related Topics

SDO_GEOM.INIT_ELEMENT

Purpose

This function initializes elements in the SDOINFO table or view for a new geometry element.

Syntax

SDO_GEOM.INIT_ELEMENT (layername, SDO_GID)

Keywords and Parameters
layername

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

SDO_GID

Specifies the geometric object identifier. Datatype is NUMBER.

Returns

This function returns the next element sequence number. The datatype is INTEGER.

Usage Notes

Consider the following when using this function:

This function initializes the element to be stored, but does not actually insert coordinates into the SDOGEOM table. The SDO_GEOM.ADD_NODES() procedure is used to insert associated coordinate data.

Related Topics

SDO_GEOM.INTERACT

Purpose

This function determines if two geometric objects interact.

Syntax

SDO_GEOM.INTERACT (layername1, SDO_GID1, [layername2,] SDO_GID2)

SDO_GEOM.INTERACT (layername1, SDO_GID1, X_tolerance, Y_tolerance, X_ordinateN, Y_ordinateN [, ..., X125, Y125])

Keywords and Parameters
layername1,
layername2

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

SDO_GID1,
SDO_GID2

Specifies the geometric object identifier. Datatype is NUMBER.

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 decimal digits matches the precision of your data.

X_ordinateN,

Y_ordinateN

Specifies the X and Y values of a vertex (coordinate pair) in a geometry. Up to 125 pairs may be specified. Datatype is NUMBER.

Returns

This function returns "TRUE" if the first and second objects interact with each other and are not disjoint. Datatype is VARCHAR2.

Usage Notes

None

Related Topics

SDO_GEOM.RELATE

Purpose

This function examines two geometric objects to determine their spatial relationship.

Syntax

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

SDO_GEOM.RELATE (layername1, SDO_GID1, mask, X_tolerance, Y_tolerance, X_ordinateN, Y_ordinateN, [,...,X125, Y125])

Keywords and Parameters
layername1,
layername2

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

SDO_GID1,
SDO_GID2

Specifies the geometric object identifier. Datatype is NUMBER.

mask

Specifies the relationship mask. See the list of keywords in the Usage section.

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 decimal digits matches the precision of your data.

X_ordinateN,

Y_ordinateN

Specifies the X and Y values of a vertex (coordinate pair) in a geometry. Up to 125 pairs may be specified. Datatype is NUMBER.

Returns

The SDO_GEOM.RELATE procedure can return three types of answers:

  1. If you pass a mask listing one or more relationships, the procedure returns the names of the relationships if all of them are true. If one or more relationships are false, the procedure returns FALSE. Datatype is VARCHAR2.

  2. If you pass the DETERMINE keyword in the mask, the procedure returns the one relationship keyword which best matches the geometries.

  3. If you pass the ANYINTERACT keyword in the mask, the procedure returns either TRUE or FALSE. This is equivalent to the SDO_GEOM.INTERACT procedure.

Usage Notes

The following relationships can be tested:

Related Topics

SDO_GEOM.VALIDATE_GEOMETRY

Purpose

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

Syntax

SDO_GEOM.VALIDATE_GEOMETRY (layername,SDO_GID)

Keywords and Parameters
layername

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

SDO_GID

Specifies the geometric object identifier. Datatype is NUMBER.

Returns

This function returns "TRUE" if the geometry is legal. Datatype is VARCHAR2.

Usage Notes

Consider the following when using this function:

This function checks for the following:

Related Topics

None



Go to previous file in sequence Go to next file in sequence
Prev Next
Oracle
Copyright © 1996 Oracle Corporation.
All Rights Reserved.
Go to Product Documentation Library
Library
Go to books for this product
Product
Go to Contents for this book
Contents
Go to Index
Index