createVoronoi: createVoronoi() creates a Voronoi tessellation

Description Usage Arguments Value Note Examples

Description

This function creates a table with polygone geometries of a Voronoi tessellation in a Postgres database.

Usage

1
createVoronoi(tableName, the_geom, ogc_fid, scale)

Arguments

tableName

The name of existing table within the Postgres database.

the_geom

The column name with the geometries of the generating points.

ogc_fid

The column name with the unique identifiers for each row element (point).

scale

The percentage of buffer distance (how far the expand outward)

Value

The function returns the name of the voronoi table that has been created.

Note

In https://gist.github.com/djq/4714788 you will find the query code to be loaded into the database. The r_voronoi(text,text,text) function is needed to create the Voronoi tessellation. createVoronoi() function exploits this code, but a small modification was required. The buffer_distance has been made flexible in contrast to the original code that sets the buffer distance to 10 The r_voronoi(text,text,text) has been replaced by the r_voronoi_scale(text,text,text,float), and TYPE was renamed as the r_voronoi_scale_type. In the original code, search for the section with the comment "calculate an approprate buffer distance (~10 to make createVoronoi() to work as explained in the example.

Examples

1
2
tableName<- all_coor_ws_2_pgdb(ghcnd='GHCND', geoid='40', type='TMAX', suffix='voronoi_example')
createVoronoi(tableName, the_geom = "geom", ogc_fid = "ogc_fid", scale = 0.25)

rabravo/ws2pgdb documentation built on May 26, 2019, 8:51 p.m.