29.10 SDO_PC_PKG.INIT

Format

SDO_PC_PKG.INIT(
     basetable          IN VARCHAR2, 
     basecol            IN VARCHAR2, 
     blktable           IN VARCHAR2, 
     ptn_params         IN VARCHAR2, 
     pc_extent          IN SDO_GEOMETRY, 
     pc_tol             IN NUMBER DEFAULT 0.0000000000005, 
     pc_tot_dimensions  IN NUMBER DEFAULT 2, 
     pc_domain          IN SDO_ORGSCL_TYPE DEFAULT NULL, 
     pc_val_attr_tables IN SDO_STRING_ARRAY DEFAULT NULL, 
     pc_other_attrs     IN XMLTYPE DEFAULT NULL 
     ) RETURN SDO_PC;

Description

Initializes a point cloud by creating an SDO_PC object.

Parameters

basetable

Name of the base table containing a column of type SDO_PC.

basecol

Name of the column of type SDO_PC in the base table.

blktable

Name of the point cloud block table, which is used for storing the blocks of point cloud. This table must exist, and must have been created by a statement in the following form: CREATE TABLE <table-name> AS select * from mdsys.sdo_pc_blk_table;

Each point cloud block table can only be associated with only one basetable and basecol combination.

ptn_params

Parameters for partitioning the point cloud, specified as a quoted string with keywords delimited by commas. For example: 'blk_capacity=1000,work_tablespace=my_work_ts'. If this parameter is null, the point cloud is not partitioned. The following keywords are permitted:

  • blk_capacity=n, where n is the maximum number of rows in each partition. The default value is 5000. If specified, must be a number greater than or equal to 50.

  • work_tablespace=x, where x is the name of the tablespace in which to create temporary tables during the partitioning operations.

pc_extent

SDO_GEOMETRY object representing the spatial extent of the point cloud (the minimum bounding object enclosing all objects in the point cloud). This parameter must not be null.

For geodetic data, this geometry must have two dimensions; otherwise, it can have up to four dimensions. The dimensionality of this geometry is used as the minimum value permitted for the pc_tot_dimensions parameter, as explained in the description of that parameter.

pc_tol

Tolerance value for objects in the point cloud. (For information about spatial tolerance, see Section 1.5.5.) If this parameter is null, the default value is 0.0000000000005.

pc_tot_dimensions

A number specifying the total dimensionality of the point cloud object. For each point in the point cloud blocks, pc_tot_dimensions ordinates (values) are stored.

The total dimensionality must be greater than or equal to the index dimensionality, which is the number of dimensions in the pc_extent geometry. Specifying total dimensionality greater than index dimensionality enables necessary nonspatial attributes to be retrieved in the same fetch operation with spatial data. The maximum total dimensionality value is 8. The default value for this parameter is 2.

pc_domain

(Not currently used.)

pc_val_attr_tables

SDO_STRING_ARRAY object specifying the names of any value attribute tables for the point cloud. If this parameter is null, the point cloud has no associated value attribute tables. Type SDO_STRING_ARRAY is defined as VARRAY(1048576) OF VARCHAR2(32).

pc_other_attrs

XMLTYPE object specifying any other attributes of the point cloud. If this parameter is null, the point cloud has no other attributes.

This parameter can include metadata on point cloud pyramiding, as explained in the Usage Notes.

Usage Notes

After you use this function to initialize an SDO_PC object, you can create a point cloud by specifying this object as input to the SDO_PC_PKG.CREATE_PC procedure.

The SDO_PC data type is described in Point Cloud-Related Object Types.

Modeling Solids describes how to use point clouds to model solids.

After you use this function, the blktable table is kept in synchronization with the base table. For example, if a row is deleted from the basetable, the corresponding blocks of the point cloud object in that row are also deleted from the block table; and if the base table base table is truncated, the block table is truncated also.

The block table can be dropped only after either of the following occurs: the base table is dropped, or the SDO_PC_PKG.DROP_DEPENDENCIES procedure is executed.

The pc_other_attrs parameter can be used to specify metadata for point cloud pyramiding, for example:

xmltype(
 '<opc:sdoPcObjectMetadata
    xmlns:opc="http://xmlns.oracle.com/spatial/vis3d/2011/sdovis3d.xsd"
    xmlns:las="http://liblas.org/schemas/LAS/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <opc:sdoPcPyramid preserveLevel1="true"/>
  </opc:sdoPcObjectMetadata>')

The XML Schema Definition (XSD) for the pc_other_attrs parameter can be viewed by entering the following statements:

SET LONG 40000
SELECT xmlschema FROM sdo_xml_schemas WHERE description = 'EPSG  sdo3d.xsd';

Point cloud pyramiding creates multiple pyramid levels from level 1 (leaves) to level n (root). Generally, points already stored at level i are not repeated, at any of the more detailed levels. Any point is physically stored, exactly once. The leaf level 1 can be exempted from this rule by specifying preserveLevel1="true" (as in the preceding example), so that applications that are not pyramiding-compliant do not need to adapt. However, this preserveLevel1="true" option (of exempting and thus preserving level 1) doubles the space requirement, because each point is then stored twice: once at root level 1, and once in the rest of the pyramid.

Examples

The following example initializes a point cloud by creating an SDO_PC object, and it displays the ID of the object. It is taken from the $ORACLE_HOME/md/demo/PointCloud/examples/plsql/pc.sql example program, which is available if you installed the files from the Oracle Database Examples media (see Oracle Database Examples Installation Guide).

. . .
declare
  pc sdo_pc;
begin
  -- Initialize the point cloud object. 
  pc := sdo_pc_pkg.init(
          'BASE', -- Table that has the SDO_POINT_CLOUD column defined
          'PC',   -- Column name of the SDO_POINT_CLOUD object 
          'BLKTAB', -- Table to store blocks of the point cloud
          'blk_capacity=1000', -- max # of points per block 
          mdsys.sdo_geometry(2003, 8307, null,
              mdsys.sdo_elem_info_array(1,1003,3),
              mdsys.sdo_ordinate_array(-180, -90, 180, 90)),  -- Extent 
              0.5, -- Tolerance for point cloud
              3, -- Total number of dimensions
              null);
. . .