Thursday, September 23, 2010

Following Appendix E Steps

1. Create table PC_TAB and add a SDO_PC column to store point cloud data
create table PC_TAB (pc SDO_PC);

2. Create PC_BLKTAB as the Block Table for the Point Cloud Data
create table PC_BLKTAB as select * from MDSYS.SDO_PC_BLK_TABLE;

3. Create INPTAB table storing Input Set of Points
CREATE SEQUENCE RID_SEQ INCREMENT BY 1 START WITH 1;

CREATE TABLE INPTAB(  RID VARCHAR2(24),  VAL_D1 NUMBER,  VAL_D2 NUMBER,  VAL_D3 NUMBER);
INSERT INTO inptab(rid, val_d1, val_d2, val_d3) SELECT RID_SEQ.NEXTVAL, X, Y, Z FROM points;
COMMIT;

4.Result Table for 3D Point Data

CREATE TABLE RESTAB (  PTN_ID NUMBER,  POINT_ID NUMBER,  RID VARCHAR2(24),  VAL_D1 NUMBER,  VAL_D2 NUMBER,  VAL_D3 NUMBER);

5. Initializing, Inserting, and Populating a Point Cloud with an Input Set of Points


DECLARE
  pc sdo_pc;
BEGIN
-- Initialize the point cloud object.
  pc := sdo_pc_pkg.init(
    'PC_TAB', -- Table that has SDO_PC column defined
    'PC', -- Column name of SDO_PC object
    'PC_BLKTAB', -- Table to store blocks of point cloud
    'blk_capacity=5000', -- Using default setting
    SDO_GEOMETRY(2003, 26910, NULL, SDO_ELEM_INFO_ARRAY(1,1003,3), SDO_ORDINATE_ARRAY(531159.776, 4272683.453, 534629.345, 4280409.657)), 0.0005, 3, NULL
  );
  -- Insert the point cloud object into the "base" table
  INSERT INTO pc_tab (pc) VALUES (pc);
 
  -- Create the blocks for the point cloud
  sdo_pc_pkg.create_pc(
    pc, --Initilized PointCloud object
    'INPTAB', -- Name of input table to ingest into the point cloud
    'RESTAB' -- Name of output table that stores the points
  );
 END;
/

PS. user who nneds
CONNECT, CREATE TABLE, CREATE VIEW, CREATE INDEX, CREATE INDEXTYPE, CREATE SEQUENCE

No comments: