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

Partitioned Point Data Functions



Spatial Data Option has undergone an architectural change for this release. A reliance on partitioned tables has changed to utilize improved spatial indexing.

The functions described in this chapter are not required for creating or maintaining a spatial database, however, they are provided for convenience in working with legacy data in partitioned point data tables. They are used with SQL SELECT, INSERT, UPDATE, and DELETE statements to perform the following functions:

When using these functions in basic SQL statements, use the form: SDO_<function>. When using the functions inside a PL*SQL block, use a period (.) instead of the underscore.

This chapter contains descriptions of the following spatial functions:

Table 8¯1 Spatial Functions

Function Name Purpose
SDO_BVALUETODIM

Creates a dimension from bounded data values.

SDO_COMPARE

Evaluates the relationship between two objects described by HHCODEs.

SDO_DATETODIM

Creates a dimension from an Oracle DATE datatype.

SDO_DECODE

Extracts a single dimension from an HHCODE.

SDO_ENCODE

Creates an HHCODE by combining dimensions to describe an area or point.

SDO_TO_BVALUE

Extracts a bounded data value from a dimension.

SDO_TO_DATE

Extracts an Oracle DATE datatype from a dimension.

Additional functions that support partitioned point data can be found in Chapter 5, "Administrative Procedures" and Appendix A, "Sample SQL Scripts".

SDO_BVALUETODIM

Purpose

This function creates a dimension from a bounded value, which is a value contained in a set of values expressed as a lower boundary and an upper boundary.

Syntax

SDO_BVALUETODIM (value, lower_boundary, upper_boundary, decimal_scale)

Keywords and Parameters
value

Specifies the value for the particular dimension.
Datatype is NUMBER.

lower_boundary

Specifies the lower boundary of the dimension range.
Datatype is NUMBER.

upper_boundary

Specifies the upper boundary of the dimension range.
Datatype is NUMBER.

decimal_scale

Specifies the number of digits to the right of the decimal point.
Datatype is NUMBER.

Returns

This function returns a dimension. Datatype is RAW.

Usage Notes

None

Example 8¯1

The following is an example of the SDO_BVALUETODIM() function:

Related Topics

SDO_COMPARE

Purpose

This function evaluates the relationship between an area or point described by an HHCODE and another HHCODE, or a range of HHCODEs expressed as an upper bound and lower bound.

Syntax

SDO_COMPARE (hhcode_expression, {hhcode_expression|lower_bound_HHCODE,upper_bound_HHCODE})

Keywords and Parameters
hhcode_expression

Specifies an expression that evaluates to an HHCODE. Datatype is RAW

lower_bound_HHCODE

Specifies the lower bound HHCODE expression. Datatype is RAW

upper_bound_HHCODE

Specifies the upper bound HHCODE expression. Datatype is RAW

Returns

This function returns one of the following:

Datatype is VARCHAR2.

Usage Notes

None

Example 8¯2

The following example selects all points which fall within the given multidimensional range:

Example 8¯3

The following example selects GID's based on interaction between their spatial index tiles:

Related Topics

SDO_DATETODIM

Purpose

This function creates a dimension from an Oracle DATE datatype. The component number determines the level of resolution of the date in the dimension.

Syntax

SDO_DATETODIM (date[, component])

Keywords and Parameters
date

Specifies the calendar date. Datatype is DATE.

component

Specifies the level of resolution. The component number values are defined as follows:

1 accurate to year
2 accurate to month
3 accurate to day
4 accurate to hour
5 accurate to minute
6 accurate to second

The default value is 6. Datatype is INTEGER.

Returns

This function returns a dimension. Datatype is RAW.

Usage Notes

Consider the following when using this function:

You must use a valid Oracle7 date format string.

Example 8¯4

The following is an example of the SDO_DATETODIM() function:

Related Topics

SDO_DECODE

Purpose

This function extracts a single dimension from an HHCODE.

Syntax

SDO_DECODE (hhcode_expression, dimension_number)

Keywords and Parameters
hhcode_expression

Specifies an expression that evaluates to an HHCODE.
Datatype is RAW.

dimension_number

Specifies the dimension number to extract.
Datatype is INTEGER.

Returns

This function returns a dimension. Datatype is RAW.

Usage Notes

Consider the following when using this function:

The SDO_DECODE() function is called once for each dimension to be decoded.

Example 8¯5

The following is an example of the SDO_DECODE() function:

Related Topics

SDO_ENCODE

Purpose

This function combines dimensions to create the HHCODE that describes an area or point.

Syntax

SDO_ENCODE (dimension1[,dimension2 ...])

Keywords and Parameters
dimension

Specifies an expression created by the SDO_BVALUETODIM or SDO_DATETODIM functions.
Datatype is RAW.

Returns

This function returns an HHCODE. Datatype is RAW.

Usage Notes

Consider the following when using this function:

Example 8¯6

The following is an example of the SDO_ENCODE() function:

Related Topics

SDO_TO_BVALUE

Purpose

This function returns the original bounded data value of a dimension.

Syntax

SDO_TO_BVALUE (dimension, lower_boundary, upper_boundary)

Keywords and Parameters
dimension

Specifies the dimension.
Datatype is RAW.

lower_boundary

Specifies the lower boundary of the dimension range.
Datatype is NUMBER.

upper_boundary

Specifies the upper boundary of the dimension range.
Datatype is NUMBER.

Returns

This function returns a bounded data value. Datatype is NUMBER.

Usage Notes

Consider the following when using this function:

This function returns a number that is the value for a dimension within the specified range. This is not necessarily the range for which the dimension was originally created.

Example 8¯7

The following is an example of the SDO_TO_BVALUE() function:

Related Topics

SDO_TO_DATE

Purpose

This function returns the original date value of a dimension.

Syntax

SDO_TO_DATE (dimension)

Keywords and Parameters
dimension

Specifies the dimension.
Datatype is RAW.

Returns

This function returns an Oracle DATE datatype.

Usage Notes

None

Example 8¯8

The following is an example of the SDO_TO_DATE() function:

Related Topics



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