workspace.H2()

class workspace.H2(config)
Arguments
  • configObject Configuration object.

Create a workspace from an H2 database.

Config Properties

database

String Path to the database (required).

Properties

H2.layers

Array The available layers in the workspace.

H2.names

Array The available layer names in the workspace.

Methods

H2.add()
Arguments
  • layerlayer.Layer() The layer to be added.

  • optionsObject 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

layer.Layer()

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.

H2.close()

Close the workspace. This discards any existing connection to the underlying data store and discards the reference to the store.

H2.get()
Arguments
  • nameString Layer name.

Returns

layer.Layer()

Get a layer by name. Returns undefined if name doesn’t correspond to a layer source in the workspace.