Format
SDO_TIN_PKG.TO_DEM( tin IN SDO_TIN, dem IN OUT SDO_GEORASTER, blocksize IN NUMBER, crs_units_per_pixel IN NUMBER);
Description
Creates a DEM (Digital Elevation Model) GeoRaster object from a TIN.
Parameters
TIN object. (The SDO_TIN data type is described in TIN-Related Object Types.)
DEM GeoRaster object.(The SDO_GEORASTER data type is described in Oracle Spatial and Graph GeoRaster Developer's Guide.)
Pixel block size for the DEM.
TIN and DEM coordinate reference system (SRID) units for each pixel. For example, if the SRID unit of measure is decimal degree and if each pixel represents 1/100 of a degree, the crs_units_per_pixel
value is 0.01
.
Usage Notes
This procedure modifies the specified GeoRaster object (dem
parameter) based on information in the input TIN.
The TIN and the DEM must have the same coordinate reference system (SRID).
For the dem
parameter, the input SDO_GEORASTER object can be obtained by inserting a GeoRaster object into a table and returning the GeoRaster object into a variable; for example:
INSERT INTO raster_table VALUES (1, sdo_geor.init('raster_data_table')) RETURNING raster_image INTO geor;
To determine the horizontal extent in pixels of the DEM, divide the horizontal extent in SRID units by the crs_units_per_pixel
parameter value. For example, assume the following:
The TIN and DEM SRID is 4326.
The SRID unit is decimal degrees.
The input TIN has a horizontal extent of 7 decimal degrees.
The crs_units_per_pixel
value is 0.01
.
In this example, the DEM horizontal extent is 700 pixels (7/.01 = 700).
The SDO_TIN data type is described in TIN-Related Object Types.
Modeling Surfaces describes how to use TINs to model surfaces.
Examples
The following example creates a DEM from a TIN. It is taken from the $ORACLE_HOME/md/demo/TIN/examples/plsql/tin.sql
example program, which is available if you installed the files from the Oracle Database Examples media (see Oracle Database Examples Installation Guide).
create table raster_table (id number, raster_image sdo_georaster); create table raster_data_table of sdo_raster (primary key (rasterId, pyramidLevel, bandBlockNumber, rowBlockNumber, columnBlockNumber)) lob(rasterblock) store as (nocache nologging); DECLARE inp sdo_tin; geor sdo_georaster; BEGIN select tin INTO inp from tins_hawaii_4326 where rownum=1; insert into raster_table values (1, sdo_geor.init('raster_data_table')) returning raster_image into geor; sdo_tin_pkg.to_dem( tin => inp, dem => geor, blocksize => 128, crs_units_per_pixel => 0.01); update raster_table set raster_image = geor where id = 1; END; /