pgtrajSchema: Check/create pgtraj schema.

Description Usage Arguments Details Value Author(s) Examples

Description

Checks if the provided schema is a valid pgtraj schema, and creates one if it does not exist.

Usage

1
pgtrajSchema(conn, schema = "traj")

Arguments

conn

Connection object created with RPostgreSQL.

schema

Character string. Name of the schema that stores or will store the pgtraj data model.

Details

Creates a schema to store pgtrajs in the database by calling a SQL script from ./sql/traj_schema.sql. The schema name defaults to traj. If a schema with the provided name already exists in the database, it checks if it contains all the required tables. The function does not attempt to repair the schema if all pgtraj tables are not present (e.g. because some were manually deleted). In this case, a new pgtraj schema needs to be created, or the existing schema needs to be deleted and recreated.

The function has its own standalone transaction control.

Value

TRUE if the schema exists (whether it was already available or was successfully created).

Author(s)

Balázs Dukai balazs.dukai@gmail.com

Examples

1
2
3
4
5
## Not run: 
  # Check (or create) pgtraj schema with name "traj_1"
  pgtrajSchema(conn,"traj_1")

## End(Not run)

rpostgisLT documentation built on May 2, 2019, 3:04 a.m.