Download Oracle Spatial User's Guide and Reference

Transcript
C
Complex Spatial Queries: Examples
This appendix provides examples, with explanations, of queries that are more
complex than the examples in the reference chapters in Part II, "Reference
Information". This appendix focuses on operators that are frequently used in Spatial
applications, such as SDO_WITHIN_DISTANCE and SDO_NN.
This appendix is based on input from Oracle personnel who provide support and
training to Spatial users. The Oracle Spatial training course covers many of these
examples, and provides additional examples and explanations.
Before you use any of the examples in this appendix, be sure you understand the
usage and reference information for the relevant operator or function in Part I,
"Conceptual and Usage Information" and Part II, "Reference Information".
This appendix contains the following major sections:
■
Section C.1, "Tables Used in the Examples"
■
Section C.2, "SDO_WITHIN_DISTANCE Examples"
■
Section C.3, "SDO_NN Examples"
■
Section C.4, "SDO_AGGR_UNION Example"
C.1 Tables Used in the Examples
The examples in this appendix refer to tables named GEOD_CITIES, GEOD_
COUNTIES, and GEOD_INTERSTATES, which are defined as follows:
CREATE TABLE GEOD_CITIES(
LOCATION
SDO_GEOMETRY,
CITY
VARCHAR2(42),
STATE_ABRV
VARCHAR2(2),
POP90
NUMBER,
Complex Spatial Queries: Examples
C-1