Using functions to generate spatial data

You can use spatial functions to generate spatial data from input data.

For example, suppose that the bank whose branches are defined in the BRANCHES table wants to know how many customers are located within five miles of each branch. Before the bank can obtain this information from the database, it needs to define the zone that lies within a specified radius around each branch. An IBM® Spatial Support for Db2 for z/OS® function, ST_Buffer, can create such a definition. Using the coordinates of each branch as input, ST_Buffer can generate the coordinates that demarcate the perimeters of the zones. The following figure shows the BRANCHES table with information that is supplied by ST_Buffer.
Figure 1. Table that includes new spatial data derived from existing spatial data. The coordinates in the SALES_AREA column were derived by the ST_Buffer function from the coordinates in the LOCATION column. Like the coordinates in the LOCATION column, those in the SALES_AREA column are simulated; they are not actual.
Begin figure description. The SALES_AREA column in the BRANCHES table contains multiple coordinate pairs 1002 2001, 1192 3564, 2502 3415, 1915 3394, 1002 2001. End figure description.

In addition to the ST_Buffer function, IBM Spatial Support for Db2 for z/OS provides several other functions that derive new spatial data from existing spatial data.