The following example performs a clip operation on a TIN. It is taken from the sdo_tin.sql example program, which is under >$ORACLE_HOME/md/demo/examples/TIN/plsql/ if you installed the files from the Oracle Database Examples mediaHTH,
But, as I said before: a 2-Dimensional TIN does not add much value. It will be flat, and give you no extra information that the normal geometry can't give you. So why you would want to do this with 2D-data?
tin := sdo_tin_pkg.init( 'RTEST', -- Table that has the SDO_TIN column defined 'MYTIN', -- Column name of the SDO_TIN object 'RBLOCK', -- Table to store blocks of the TIN 'blk_capacity=1000', -- max # of points per block mdsys.sdo_geometry(2003, null, null, mdsys.sdo_elem_info_array(1,1003,3), mdsys.sdo_ordinate_array(-180, -90, 180, 90)), -- Extent 0.0000000005, -- Tolerance for TIN 2, -- Total number of dimensions null); -- Create the blocks for the TIN. sdo_tin_pkg.create_tin( tin, -- Initialized TIN object 'RPOINTS', -- Name of input table to ingest into the pointcloud );
The number of polygons in the SDO_GEOMETRY is limited by the number of ordinates that can be in the SDO_ORDINATES_ARRAY.according to [url http://docs.oracle.com/cd/E11882_01/appdev.112/e11830/sdo_intro.htm#BABJBBEB]the documentation.
An SDO_TIN object, on the other hand, models the surface as a network of triangles with no explicit limit on the number of triangles.
Add ENDRESULT to USER_SDO_GEOM_METADATA, and any application that can access Oracle's SDO_GEOMETRY should be able to show you what the result is.
Create table ENDRESULT (ID NUMBER, geom SDO_GEOMETRY); insert into ENDRESULT (ID, GEOM) values (1, SDO_TIN_PKG.TO_GEOMETRY(<fill in parameters>));