Oracle7 Spatial Data Option User's Guide and Reference |
Library |
Product |
Contents |
Index |

This chapter contains descriptions of the geometric functions and procedures shown in Table 7-1:

This procedure stores coordinate geometry points into the SDOGEOM table.

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

None

- Use the SQL CREATE TABLE statement to create the geometry table,
*<layername>*_SDOGEOM, before calling this procedure. - Prior to calling this procedure, call the SDO_GEOM.INIT_ELEMENT() function to initialize the geometry element and retrieve the element sequence number (SDO_ESEQ).
- Close a polygon by providing the coordinates of the first vertex as the last vertex.
- Call this procedure iteratively with the same GID to add coordinates to a geometric object. You can add up to 125 coordinate pairs on each call, and there is no limit to how many times you can add more vertices.
- This procedure cannot be used when
*<layername*>_SDOGEOM is a view. For layer objects created as views, you need to explicitly insert new geometries, as opposed to using the provided stored procedures SDO_GEOM.INIT_ELEMENT() and SDO_GEOM.ADD_NODES().

Example 7-1 adds polygon element for geometry 25 in the LAYER1 data set. The polygon is a square.

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

SDO_GEOM.INIT_ELEMENT (layername, SDO_GID)

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

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.

For layer objects created as views, you need to explicitly insert new geometries, as opposed to using the provided stored procedures SDO_GEOM.INIT_ELEMENT() and SDO_GEOM.ADD_NODES().

This function determines if two geometric objects interact.

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

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

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

Use the first form of the function to test 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 250 values.

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

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]])

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

- 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. Data type is VARCHAR2.
- If you pass the DETERMINE keyword in the mask, the procedure returns the one relationship keyword that best matches the geometries.
- If you pass the ANYINTERACT keyword in the mask, the procedure returns either TRUE if the two geometries are not disjoint. This is equivalent to the SDO_GEOM.INTERACT procedure.

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 250 values.

The following relationships can be tested:

- ANYINTERACT - Returns true if the objects are not disjoint.
- CONTAINS - Returns true if the second object is entirely within the first object and the object boundaries do not touch.
- COVEREDBY - Returns true if the first object is entirely within the second object and the object boundaries touch at one or more points.
- COVERS - Returns true if the second object is entirely within the first object and the boundaries touch in one or more places.
- DISJOINT - Returns true if the objects have no common boundary or interior points.
- EQUAL - Returns true if the objects share every point of their boundaries and interior, including any holes in the objects.
- INSIDE - Returns true if the first object is entirely within the second object and the object boundaries do not touch.
- OVERLAPBDYDISJOINT - Returns true if the objects overlap, but their boundaries do not interact.
- OVERLAPBDYINTERSECT - Returns true if the object overlap, and their boundaries intersect in one or more places.
- TOUCH - Returns true if the two objects share a common boundary point, but no interior points.

Mask values can be combined using a logical OR. For example, `INSIDE + TOUCH' returns TRUE if the objects pass either test.

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.

SDO_GEOM.VALIDATE_GEOMETRY (layername,SDO_GID)

This function returns TRUE if the geometry is valid. Data type is VARCHAR2.

Consider the following when using this function:

This function checks for the following:

- polygons have at least three points and must be closed
- line strings must have at least two points
- when and SDO_ESEQ spans multiple rows, the last point of the previous row is the first point on the next row

None

Prev Next |
Copyright © 1997 Oracle Corporation. All Rights Reserved. |
Library |
Product |
Contents |
Index |