SDO_UTIL.TILE_GEOMETRY

Format

SDO_UTIL.TILE_GEOMETRY(
  geom                   IN SDO_GEOMETRY,
  x_axis_min             IN NUMBER,
  x_axis_max             IN NUMBER,
  y_axis_min             IN NUMBER,
  y_axis_max             IN NUMBER,
  tile_resolution        IN NUMBER,
  resolution_factor      IN NUMBER   := 0,
  perform_intersection   IN VARCHAR2 := 'TRUE',
  compute_percent        IN VARCHAR2 := 'FALSE',
  geodetic_tolerance     IN NUMBER   := .05)
  RETURN mdsys.tile_geom_table_type DETERMINISTIC
         PIPELINED PARALLEL_ENABLE;

Description

Tiles a geometry based on the specified tile resolution and resolution factor. Returns MDSYS.TILE_GEOM_TABLE_TYPE, which is a table of MDSYS.TILE_GEOM_TYPE objects.

Parameters

geom

Geometry to tile.

x_axis_min

Minimum value along the x-axis for tiling domain. (See the Usage Notes for more information.)

x_axis_max

Maximum value along the x-axis for tiling domain. (See the Usage Notes for more information.)

y_axis_min

Minimum value along the y-axis for tiling domain. (See the Usage Notes for more information.)

y_axis_max

Maximum value along the y-axis for tiling domain. (See the Usage Notes for more information.)

tile_resolution

Tile size value. (See the Usage Notes for more information.)

resolution_factor

A value factor applied to the tile_resolution parameter.

Default value is 0. (See the Usage Notes for more information.)

perform_intersection

A string value of TRUE (the default) clips boundary tiles to the geometry boundary.

A string value of FALSE returns full tiles along the geometry boundary.

compute_percent

The default string value is FALSE.

A string value of TRUE computes the value between 0 and 1. To compute this value perform_intersection must also be set to TRUE.

geodetic_tolerance

Default is 0.05.

This parameter is only used if the geometry to tile is longitude/latitude. The default value can be overridden with a value smaller than 0.05.

Usage Notes

The SDO_UTIL.TILE_GEOMETRY function can be used to:

This function returns a table of type MDSYS.TILE_GEOM_TABLE_TYPE, which is defined as follows:

CREATE OR REPLACE TYPE mdsys.tile_geom_table_type AS TABLE OF tile_geom_type;

The object type MDSYS.TILE_GEOM_TYPE, used in the preceding code, is defined as follows:

CREATE OR REPLACE TYPE mdsys.tile_geom_type AS OBJECT (
  tile_id      NUMBER,
  status       CHAR,
  percent      NUMBER,
  tile_center  SDO_GEOMETRY,
  geom         SDO_GEOMETRY);

The parameters used to define the object type, MDSYS.TILE_GEOM_TYPE are:

The parameters, x_axis_min, x_axis_max, y_axis_min and y_axis_max used in the SDO_UTIL.TILE_GEOMETRY function, represent the tiling domain. The tiling domain is an extent that contains all the geometries that are required to tile. For example, for longitude/latitude geometries, a tiling domain can be specified using the following parameter values:

The tile_resolution and resolution_factor parameters influence the tile size as highlighted in the following:

Examples

The following examples tile geometries with the tiles that coincide with the cells of a raster. Also, the raster extent is projected (not longitude, latitude), so the domain extent is set to the extent of the raster. The parameter, perform_intersection => 'TRUE' in the examples, causes clipping of the boundary tiles to the boundary of the farm.

Example 1

This example tiles a farm geometry with tiles that are equal to the size of a raster cell. The resolution of the raster is 1000, so tiles will be 1000x1000

WITH
  part0 AS (SELECT b.tile_id,
                   b.status,
                   b.percent,
                   b.tile_center,
                   b.geom
            FROM farm_plots a,
            TABLE (sdo_util.tile_geometry(geom                 => a.geom,
                                          x_axis_min           => 272039.5,
                                          x_axis_max           => 275188.5,
                                          y_axis_min           => 370575.5,
                                          y_axis_max           => 380165.5,
                                          tile_resolution      => 1000,
                                          resolution_factor    => 0,
                                          perform_intersection => 'TRUE',
                                          compute_percent      => 'TRUE',
                                          geodetic_tolerance   => NULL)) b
            WHERE a.id = -1)
 SELECT tile_id, geom FROM part0 ORDER BY tile_id;

The following figure depicts the resulting output:

Figure: Tile size same astile_resolution

Description of the illustration tile_geometry_same_tile_size.png

Example 2

The following example tiles a farm geometry with tiles that are 1/4 times smaller than 1000 x 1000, because resolution_factor => 1 is specified.

WITH
  part0 AS (SELECT b.tile_id,
                   b.status,
                   b.percent,
                   b.tile_center,
                   b.geom
            FROM farm_plots a,
            TABLE (sdo_util.tile_geometry(geom                 => a.geom,
                                          x_axis_min           => 272039.5,
                                          x_axis_max           => 275188.5,
                                          y_axis_min           => 370575.5,
                                          y_axis_max           => 380165.5,
                                          tile_resolution      => 1000,
                                          resolution_factor    => 1,
                                          perform_intersection => 'TRUE',
                                          compute_percent      => 'TRUE',
                                          geodetic_tolerance   => NULL)) b
            WHERE a.id = -1)
 SELECT tile_id, geom FROM part0 ORDER BY tile_id;

The following figure depicts the resulting output:

Figure: Tile size smaller thantile_resolution

Description of the illustration tile_geometry_small_tile_size.png

Example 3

The following example tiles a farm geometry with tiles that are 4 times greater than 1000 x 1000, because resolution_factor => -1 is specified.

WITH
  part0 AS (SELECT b.tile_id,
                   b.status,
                   b.percent,
                   b.tile_center,
                   b.geom
            FROM farm_plots a,
            TABLE (sdo_util.tile_geometry(geom                 => a.geom,
                                          x_axis_min           => 272039.5,
                                          x_axis_max           => 275188.5,
                                          y_axis_min           => 370575.5,
                                          y_axis_max           => 380165.5,
                                          tile_resolution      => 1000,
                                          resolution_factor    => -1,
                                          perform_intersection => 'TRUE',
                                          compute_percent      => 'TRUE',
                                          geodetic_tolerance   => NULL)) b
            WHERE a.id = -1)
 SELECT tile_id, geom FROM part0 ORDER BY tile_id;

The following figure depicts the resulting output:

Figure: Tile size greater thantile_resolution

Description of the illustration tile_geometry_big_tile_size.png