Oracle Spatial and Graph supports the storage and retrieval of three-dimensional spatial data, which can include points, point clouds (collections of points), lines, polygons, surfaces, and solids. Table 1-1 shows the SDO_GTYPE and element-related attributes of the SDO_GEOMETRY type that are relevant to three-dimensional geometries. (The SDO_GEOMETRY type is explained in SDO_GEOMETRY Object Type.)
Table 1-1 SDO_GEOMETRY Attributes for Three-Dimensional Geometries
Type of 3-D Data | SDO_GTYPE | Element Type, Interpretation in SDO_ELEM_INFO |
---|---|---|
Point |
3001 |
Does not apply. Specify all 3 dimension values in the SDO_POINT_TYPE attribute. |
Line |
3002 |
2, 1 |
Polygon |
3003 |
1003, 1: planar exterior polygon 2003, 1: planar interior polygon 1003, 3: planar exterior rectangle 2003, 3: planar interior rectangle |
Surface |
3003 |
1006, 1: surface (followed by element information for the polygons) |
Collection |
3004 |
Same considerations as for two-dimensional |
Multipoint (point cloud) |
3005 |
1, n (where n is the number of points) |
Multiline |
3006 |
2, 1 (same as for Line) |
Multisurface |
3007 |
Element definitions for one or more surfaces |
Solid |
3008 |
Simple solid formed by a single closed surface: one element type 1007, followed by one element type 1006 (the external surface) and optionally one or more element type 2006 (internal surfaces) Composite solid formed by multiple adjacent simple solids: one element type 1008 (holding the count of simple solids), followed by any number of element type 1007 (each describing one simple solid) |
Multisolid |
3009 |
Element definitions for one or more simple solids (element type 1007) or composite solids (element type 1008) |
The following spatial operators consider all three dimensions in their computations:
SDO_INSIDE (for solid geometries only)
The other operators consider only the first two dimensions. For some of preceding operators the height information is ignored when dealing with geodetic data, as explained later in this section. (Spatial operators are described in Spatial Operators .)
The SDO_GEOM.SDO_VOLUME function applies only to solid geometries, which are by definition three-dimensional; however, this function cannot be used with geodetic data. (This function is described in SDO_GEOM Package (Geometry).) For information about support for three-dimensional geometries with other SDO_GEOM subprograms, see the usage information after Table 23-1.
For distance computations with three-dimensional geometries:
If the data is geodetic (geographic 3D), the distance computations are done on the geodetic surface.
If the data is non-geodetic (projected or local), the distance computations are valid only if the unit of measure is the same for all three dimensions.
To have any functions, procedures, or operators consider all three dimensions, you must specify PARAMETERS ('sdo_indx_dims=3')
in the CREATE INDEX statement when you create the spatial index on a spatial table containing Geographic3D data (longitude, latitude, ellipsoidal height). If you do not specify that parameter in the CREATE INDEX statement, a two-dimensional index is created.
For spatial functions, procedures, and operators that consider all three dimensions, distance and length computations correctly factor in the height or elevation. For example, consider two three-dimensional points, one at the origin of a Cartesian space (0,0,0), and the other at X=3 on the Y axis and a height (Z) of 4 (3,0,4).
If the operation considers all three dimensions, the distance between the two points is 5. (Think of the hypotenuse of a 3-4-5 right triangle.)
If the operation considers only two dimensions, the distance between the two points is 3. (That is, the third dimension, or height, is ignored.)
However, for the following operators and subprograms, when dealing with geodetic data, the distances with three-dimensional geometries are computed between the "ground" representations (for example, the longitude/latitude extent of the footprint of a building), and the height information is approximated:
SDO_NN operator
SDO_WITHIN_DISTANCE operator
SDO_GEOM.SDO_DISTANCE function
SDO_GEOM.WITHIN_DISTANCE function
For a two-dimensional query window with three-dimensional data, you can use the SDO_FILTER operator, but not any other spatial operators.
For examples of creating different types of three-dimensional spatial geometries, see Three-Dimensional Geometry Types. That section also includes an example showing how to update the spatial metadata and create spatial indexes for three-dimensional geometries.
For information about support for three-dimensional coordinate reference systems, see Three-Dimensional Coordinate Reference System Support.
Three-dimensional support does not apply to many spatial aggregate functions and PL/SQL packages and subprograms. The following are supported for two-dimensional geometries only:
Spatial aggregate functions, except for SDO_AGGR_MBR, which is supported for both two-dimensional and three-dimensional geometries.
SDO_GEOM (geometry) subprograms, except for the following, which are supported for both two-dimensional and three-dimensional geometries:
SDO_GEOM.RELATE with the ANYINTERACT mask
SDO_SAM (spatial analysis and mining) subprograms
SDO_MIGRATE.TO_CURRENT procedure
Table 1-2 describes how Oracle Spatial and Graph internally performs certain geodetic three-dimensional calculations.
Table 1-2 How Geodetic 3D Calculations Are Performed
Type of Calculation | Internal Calculations Performed |
---|---|
ANYINTERACT |
The input geometries are transformed using Gnomonic transformation; then the ANYINTERACT relationship is computed with the resulting geometries. |
Area |
The input geometry is projected onto a local tangent plane; then the area is computed with the resulting input geometry. |
Distance or Length |
The 2D precise ellipsoidal distance is computed using the longitude/latitude of the two closest points of approach; then the height or length difference is included using an approximation. |
Volume |
The input geometry is projected onto a local tangent plane; then the volume is computed with the resulting input geometry. |