Oracle7 Spatial Data Option User's Guide and Reference | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
Spatial Data Option has undergone an architectural change for this release. A reliance on partitioned tables has changed to utilize improved spatial indexing.
This chapter contains descriptions of the following spatial functions:
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
SQL> INSERT INTO sourcetable1(SAMPLENAME,DATA_PT)
2> VALUES ('SAMPLE1',SDO_ENCODE(SDO_BVALUETODIM(10,-100,100,7),
3> SDO_BVALUETODIM(20,-100,100,7));
SQL> SELECT SDO_GID FROM layer1_SDOINDEX WHERE
2> SDO_COMPARE(SDO_MAXCODE,
3> SDO_ENCODE(5,5),
4> SDO_ENCODE(25,25))='INSIDE';
SQL> SELECT SDO_GID FROM layer1_SDOINDEX A, layer2_SDOINDEX B
2> WHERE SDO_COMPARE(A.SDO_CODE,B.SDO_CODE) != 'OUTSIDE';
You must use a valid Oracle7 date format string.
SQL> INSERT INTO sourcetable1(SAMPLENAME,DATA_PT)
2> VAUES('SAMPLE1',SDO_ENCODE(SDO_DATETODIM(TO_DATE('19-Jul-96'),
3> SDO_BVALUETODIM(100,-1000,1000,7)));
hhcode_expression
|
Specifies an expression that evaluates to an HHCODE. Datatype is RAW.
|
dimension_number
|
Specifies the dimension number to extract. Datatype is INTEGER.
|
The SDO_DECODE() function is called once for each dimension to be decoded.
SQL> SELECT
2> SDO_TO_BVALUE(SDO_DECODE(DATA_PT,1),1,6),
3> SDO_TO_BVALUE(SDO_DECODE(DATA_PT,2),-100,100),
4> SDO_TO_DATE(SDO_DECODE(DATA_PT,3))
5> FROM sourcetable1 WHERE SAMPLENAME='SAMPLE1';
dimension
|
Specifies an expression created by the SDO_BVALUETODIM or SDO_DATETODIM functions. Datatype is RAW.
|
SQL> INSERT INTO sourcetable1(SAMPLENAME,DATA_PT)
2> VALUES ('SAMPLE1',SDO_ENCODE(SDO_BVALUETODIM(500,6),
3> SDO_BVALUETODIM(30,-100,100,10),
4> SDO_DATETODIM(TO_DATE('05-Jul-96'),3)));
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.
SQL> SELECT (SDO_TO_BVALUE(SDO_DECODE(DATA_PT,2),-100,100)
2> FROM sourcetable1 WHERE SAMPLENAME='SAMPLE1';
dimension
|
Specifies the dimension. Datatype is RAW.
|
SQL> SELECT SDO_TO_DATE(SDO_DECODE(DATA_PT,3))
2> FROM sourcetable1 WHERE SAMPLENAME='SAMPLE1';
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |