The simplest types of solids can be represented as cuboids, such as a cube or a brick. A more complex solid is a frustum, which is a pyramid formed by cutting a larger pyramid (with three or more faces) by a plane parallel to the base of that pyramid. Frustums are sometimes used as query windows to spatial operators. Frustums and cubes are typically modeled as solid-type SDO_GEOMETRY objects. Figure 1-9 shows a frustum as a query window, with two spatial objects at different distances from the view point.
Figure 1-9 Frustum as Query Window for Spatial Objects
Point clouds, which are large collections of points, can sometimes be used to model the shape or structure of solid and surface geometries. Most applications that use point cloud data contain queries based on ___location. Applications can also go outside Spatial and Graph to add visibility logic to perform queries based on both ___location and visibility.
Most applications that use point cloud data seek to minimize data transfer by retrieving objects based on their distance from a view point. For example, in Figure 1-9, object B is farther from the view point than object A, and therefore the application might retrieve object A in great detail (high resolution) and object B in less detail (low resolution). In most scenarios, the number of objects or points increases significantly as the distance from the view point increases; and if farther objects are retrieved at lower resolutions than nearer objects, the number of bytes returned by the query and the rendering time for the objects decrease significantly.
For storage of point cloud data, you can use either an SDO_PC object or is a flat table. The approach to use depends on your hardware environment and usage patterns. An advantage of the flat format is its efficient and dynamic nature, because updates to the point data do not require reblocking.
The general process for working with a point cloud is as follows, depending on whether the point cloud data will be stored in an SDO_PC object or in a flat table.
To use point cloud data stored as an SDO_PC object:
Initialize the point cloud, using the SDO_PC_PKG.INIT function.
Create the point cloud, using the SDO_PC_PKG.CREATE_PC procedure.
As needed for queries, clip the point cloud, using the SDO_PC_PKG.CLIP_PC function.
If necessary, use the SDO_PC_PKG.TO_GEOMETRY function (for example, to convert the result of a clip operation into a single SDO_GEOMETRY object).
To use point cloud data stored in a flat table:
Create the table (or a view based on an appropriate table) for the point cloud data.
Each row will contain the values of the first three spatial dimensions of a point, and optionally values for nonspatial dimensions. The table or view definition must start with the following columns: VAL_D1 NUMBER, VAL_D2 NUMBER, VAL_D3 NUMBER. It can also contain columns for point cloud nonspatial dimensions.
Populate the table with point data.
As needed for queries, clip the point cloud, using the SDO_PC_PKG.CLIP_PC_FLAT function.
The PL/SQL subprograms for working with point clouds are described in SDO_PC_PKG Package (Point Clouds).
For a Java example of working with point clouds, see the following files:
$ORACLE_HOME/md/demo/PointCloud/examples/java/README.txt $ORACLE_HOME/md/demo/PointCloud/examples/java/readPointCloud.java