10.12.2012 Views

Oracle Spatial User's Guide and Reference - InfoLab

Oracle Spatial User's Guide and Reference - InfoLab

Oracle Spatial User's Guide and Reference - InfoLab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples<br />

Table 12–3 params Keywords for the SDO_JOIN Operator<br />

Keyword Description<br />

SDO_JOIN<br />

mask The topological relationship of interest.Valid values are<br />

'mask=' where is one or more of the mask<br />

values valid for the SDO_RELATE operator (TOUCH,<br />

OVERLAPBDYDISJOINT, OVERLAPBDYINTERSECT, EQUAL,<br />

INSIDE, COVEREDBY, CONTAINS, COVERS, ANYINTERACT,<br />

ON), or FILTER, which checks if the MBRs (the filter-level<br />

approximations) intersect. Multiple masks are combined with<br />

the logical Boolean operator OR (for example,<br />

'mask=inside+touch'); however, FILTER cannot be<br />

combined with any other mask.<br />

If this parameter is null or contains an empty string,<br />

mask=FILTER is assumed.<br />

distance Specifies a numeric distance value that is added to the<br />

tolerance value (explained in Section 1.5.5) before the<br />

relationship checks are performed. For example, if the<br />

tolerance is 10 meters <strong>and</strong> you specify 'distance=100<br />

unit=meter', two objects are considered to have spatial<br />

interaction if they are within 110 meters of each other.<br />

If you specify distance but not unit, the unit of<br />

measurement associated with the data is assumed.<br />

unit Specifies a unit of measurement to be associated with the<br />

distance value (for example, 'distance=100<br />

unit=meter'). See Section 2.6 for more information about<br />

unit of measurement specification. If you specify unit, you<br />

must also specify distance.<br />

Data type is VARCHAR2. Default = unit of measurement<br />

associated with the data. For geodetic data, the default is<br />

meters.<br />

The following example joins the COLA_MARKETS table with itself to find, for each<br />

geometry, all other geometries that have any spatial interaction with it. (The<br />

example uses the definitions <strong>and</strong> data from Section 2.1.) In this example, rowid1<br />

<strong>and</strong> rowid2 correspond to the names of the attributes in the SDO_ROWIDPAIR<br />

type definition. Note that in the output, cola_d (the circle in Figure 2–1) interacts<br />

only with itself, <strong>and</strong> not with any of the other geometries.<br />

SELECT a.name, b.name FROM cola_markets a, cola_markets b,<br />

TABLE(SDO_JOIN('COLA_MARKETS', 'SHAPE', 'COLA_MARKETS', 'SHAPE',<br />

'mask=ANYINTERACT')) c<br />

<strong>Spatial</strong> Operators 12-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!