1.2. postgis.erl

Build SQL commend to manipulate geometric objects in a Postgis database.

The postgis module uses the randomcoord module to generate random datas.

1.2.1. Tsung Exports

Functions exported by the postgis module callable by Tsung. All functions which name that begins with r_ return random data.

1.2.1.1. r_point/1

The function r_point/1 returns a SQL command to build an ST_Point.

Paramaters : Tsung tuple {Pid, DynVars}

Return : string

12> postgis:r_point({Pid, DynVars}).
"ST_Point(69.896366, 63.997280)"

1.2.1.2. r_point_srid/1

The r_point_srid/1 functions works like r_point/1 but enclose the ST_Point() result in SetSRID() postgis function.

Paramaters : Tsung tuple {Pid, DynVars}

Return : string

12> postgis:r_point_srid({Pid, DynVars}).
"ST_SetSRID(ST_Point(69.896366, 63.997280), 4326)"

1.2.1.3. r_box2d/1

The function r_box2d/1 returns a SQL command to build a 2 dimension box with the ST_MakeBox2D.

Paramaters : Tsung tuple {Pid, DynVars}

Return : string

11> postgis:r_box2d_srid({Pid, Dynvars}).

"ST_SetSRID(ST_MakeBox2d(ST_Point(-72.170899, 51.890770),
ST_Point(30.764721, 75.803965))), 4326)"

1.2.1.4. r_box2d_srid/1

The function r_box2d_srid/1 works like r_box2d/1 but enclose the result in SetSRID() postgis function.

Paramaters : Tsung tuple {Pid, DynVars}

Return : string

10> postgis:r_box2d({Pid, Dynvars}).
"ST_MakeBox2d(ST_Point(67.792555, -58.145776), ST_Point(163.686023,
88.730874))"