workspace.PostGIS()
¶
-
class
workspace.
PostGIS
(config)¶ - Arguments
config –
Object
Configuration object.
Create a workspace from a PostGIS enabled database.
Config Properties¶
-
database
String
Database name (required).
-
host
String
Hostname for database connection. Default is"localhost"
.
-
password
String
Password for database connection. Default is"postgres"
.
-
port
Number
Port for database connection. Default is5432
.
-
schema
String
The named database schema containing the tables to be accessed. Default is"public"
.
-
user
String
Username for database connection. Default is"postgres"
.
Properties¶
-
PostGIS.
layers
¶ Array
The available layers in the workspace.
-
PostGIS.
names
¶ Array
The available layer names in the workspace.
Methods¶
-
PostGIS.
add
()¶ - Arguments
layer –
layer.Layer()
The layer to be added.options –
Object
Options for adding the layer.
Options:
name:
String
Name for the new layer.filter:
filter.Filter()
Filter to apply to features before adding.projection:
proj.Projection()
Destination projection for the layer.
- Returns
Create a new layer in this workspace with the features from an existing layer. If a layer with the same name already exists in this workspace, you must provide a new name for the layer.
-
PostGIS.
close
()¶ Close the workspace. This discards any existing connection to the underlying data store and discards the reference to the store.
-
PostGIS.
get
()¶ - Arguments
name –
String
Layer name.
- Returns
Get a layer by name. Returns
undefined
if name doesn’t correspond to a layer source in the workspace.