Carry out the following steps to create the functions:
- Create a new schema named chp12 to store the data for all the recipes in this chapter using the following command:
postgis_cookbook=# create schema chp12;
- The implementation of Rand requires the creation of a PLPGSQL function that receives the radius parameter, which defines the maximum distance, and the geometry the_geom to be altered.
The ST_Project function will move the point to a given distance and angle from its original location. In order to simplify the expression, we will use polar noise generation. Execute the following SQL command:
postgis_cookbook=# CREATE OR REPLACE FUNCTION chp12.rand(radius numeric, the_geom geometry) returns geometry as $$ BEGIN ...