{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

scan0070 - Spatial Aggregate Functions I With operators...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Spatial Aggregate Functions I With operators, always specify TRUE in uppercase. That is, specify : ‘ TRUE ' , and do not specify <> 'FALSE' or = 'true '. I With operators, use the /*+ ORDERED * / optimizer hint if the query window comes from a table. (You must use this hint if multiple windows come from a table.) See the Usage Notes and Examples for specific operators for more information. For information about using operators with topologies, see Oracle Spatial Topology and Network Data Models. 1.10 Spatial Aggregate Functions SQL has long had aggregate functions, which are used to aggregate the results of a SQL query. The following example uses the SUM aggregate function to aggregate employee salaries by department: SELECT SUM(sa1ary), dept FROM employees GROUP BY dept; Oracle S _atial a e ate functions a re ate the re ults of SQL queries inVQlying gegrfléfiygbiects. Spatial aggregate functions return a geometry object of type SDO‘ \GEOMETRY. For example, the following statement returns the minimum bounding rectangle of all geometries in a table (using the definitions and data from Section 2.1): SELECT SDO_A®ER(shapel FROM cola_markets,~ The following example returns the union of all geometries except cola_d: SELECT SDO_AGGR_UNION(SDOAGGRTYPE(c.5hape, 0.005)) FROM cola_markets c WHERE c.name < 'cola_d',~ A11 geometries used with spatial aggregate functions must be defined using 4-digit SDO_GTYPE values (that is, must be in the format used by Oracle Spatial release 8.1.6 or later). For information about SDO_GTYPE values, see Section 2.2.1. For reference information about the spatial aggregate functions and examples of their use, see Chapter 12. 1.10.1 SDOAGGRTYPE Object Type Many spatial aggregate functions accept an input parameter of type SDOAGGRTYPE. Oracle Spatial defines the object type SDOAGGRTYPE as: CREATE TYPE sdoaggrtype AS OBJECT [ geometry SDO_GEOMETRY, tolerance NUMBER) ; Note: Do not use SDOAGGRTYPE as the data type for a column in a table. Use this type only in calls to spatial aggregate functions. The tolerance value in the SDOAGGRTYPE definition should be the same as the SDO_TOLERANCE value specified in the DIMINFO column in the xxx_SDO_GEOM_ METADATA views for the geometries, unless you have a specific reason for wanting a different value. For more information about tolerance, see Section 1.5.5; for information about the xxx_SDO_GEOM_METADATA views, see Section 2.6. 1-14 Oracle Spatial User‘s Guide and Reference k 1112 ,F ...
View Full Document

{[ snackBarMessage ]}