User's Guide and Reference

ST_ExteriorRing

ST_ExteriorRing takes a polygon and returns its exterior ring as a linestring.

Syntax

db2gse.ST_ExteriorRing(s db2gse.ST_Polygon)

Return type

db2gse.ST_LineString

Examples

An ornithologist who is studying the bird population on several south sea islands, knows that the feeding zone of a particular bird species is restricted to the shoreline. To calculate of the island's carrying capacity, the ornithologist requires the island's perimeter. Although some of the islands have several ponds on them, the shorelines of the ponds are inhabited exclusively by another more aggressive bird species. Therefore, the ornithologist requires the perimeter of the exterior ring of the islands.

The ID and NAME columns of the ISLANDS table identify each island, and the LAND column of type ST_Polygon stores the geometry of each.

CREATE TABLE ISLANDS (id   integer,
                           name   varchar(32),
                           land   db2gse.ST_Polygon);

The ST_ExteriorRing function extracts the exterior ring from each island polygon as a linestring. The length of the linestring is established by the length function. The linestring lengths are summarized by the SUM function.

SELECT SUM(db2gse.ST_length(db2gse.ST_ExteriorRing (land))) FROM ISLANDS;

In Figure 33, the exterior rings of the islands represent the ecological interface that each island shares with the sea. Some of the islands have lakes, which are represented by the interior rings of the polygons.

Figure 33. Using ST_ExteriorRing to determine the length of an island shore line


top


[ Top of Page | Previous Page | Next Page ]