ST_Area takes a polygon or multipolygon and returns its area.
Syntax
db2gse.ST_Area(s db2gse.ST_Surface)
Return type
Double
Examples
The city engineer needs a list of building areas. To obtain the list, a GIS technician selects the building ID and area of each building's footprint.
The building footprints are stored in the BUILDINGFOOTPRINTS table that was created with the following CREATE TABLE statement:
CREATE TABLE BUILDINGFOOTPRINTS ( building_id integer,
lot_id integer,
footprint db2gse.ST_MultiPolygon);
To satisfy the city engineer's request, the technician uses the following SELECT statement to select the unique key, the building_id, and the area of each building footprint from the BUILDINGFOOTPRINTS table:
SELECT building_id, db2gse.ST_Area (footprint) "Area" FROM BUILDINGFOOTPRINTS;
The SELECT statement returns the following result set:
building_id Area
------------ ------------------------
506 +1.40768000000000E+003
1208 +2.55759000000000E+003
543 +1.80786000000000E+003
178 +2.08671000000000E+003
.
.
.
Figure 28. Using area to find a building footprint. Four of the building footprints labeled with their building ID numbers are displayed along side their adjacent street.
![]() |