25.04.2013 Views

View PDF

View PDF

View PDF

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.

Usage Notes<br />

Examples<br />

SDO_SAM.TILED_AGGREGATES<br />

zero_agg_tiles<br />

Specify 0 to exclude tiles that have a value of 0 for the computed aggregate, or specify<br />

1 to return all tiles. The default value is 0, which ensures that only tiles with a nonzero<br />

aggregate value are returned.<br />

xdivs<br />

The number of times that the extent in the first dimension is divided, such that the<br />

total number of parts is xdivs + 1. For example, if you specify 10 for xdivs, the<br />

extent of the first dimension is divided into 11 parts.<br />

ydivs<br />

The number of times that the extent in the second dimension is divided, such that the<br />

total number of parts is ydivs + 1. For example, if you specify 10 for ydivs, the<br />

extent of the second dimension is divided into 11 parts.<br />

This function is similar to SDO_SAM.AGGREGATES_FOR_LAYER, but the results are<br />

dynamically generated using tiling information. Given a theme_name table, the tiling<br />

domain is determined. Based on the tiling_level value or the xdivs and ydivs<br />

values, the necessary tiles are generated. For each tile geometry, thematic aggregates<br />

are computed as described in the Usage Notes for SDO_SAM.AGGREGATES_FOR_<br />

LAYER.<br />

You must specify either the tiling_level parameter or both the xdivs and ydivs<br />

parameters. If you specify all three of these parameters, the tiling_level parameter<br />

is ignored and the xdivs and ydivs parameters are used.<br />

If you specify the xdivs and ydivs parameters, the total number of grids (tiles)<br />

returned is (xdivs+1)*(ydivs+1).<br />

This function returns an object of type SDO_REGAGGRSET. The SDO_REGAGGRSET<br />

object type is defined as:<br />

TABLE OF SDO_REGAGGR<br />

The SDO_REGAGGR object type is defined as:<br />

Name Null? Type<br />

----------------------------------------- -------- ----------------------------<br />

REGION_ID VARCHAR2(24)<br />

GEOMETRY MDSYS.SDO_GEOMETRY<br />

AGGREGATE_VALUE NUMBER<br />

The following example computes the sum of the population rows of POLY_4PT_TEMP<br />

table intersecting with each tile. The extent of the POLY_4PT_TEMP table stored in the<br />

USER_SDO_GEOM_METADATA view is used as the domain, and a tiling level of 2 is<br />

used (that is, the domain is divided into 16 tiles).<br />

SELECT a.geometry, a.aggregate_value<br />

from TABLE(sdo_sam.tiled_aggregates('POLY_4PT_TEMP',<br />

'GEOMETRY', 'SUM', 'POPULATION', 2)) a;<br />

GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)<br />

--------------------------------------------------------------------------------<br />

AGGREGATE_VALUE<br />

---------------<br />

SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARR<br />

AY(-180, -90, -90, -45))<br />

SDO_SAM Package (Spatial Analysis and Mining) 29-19

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

Saved successfully!

Ooh no, something went wrong!