class Workspace extends java.lang.Object
A Workspace is a container of Layers.
Constructor and description |
---|
Workspace(DataStore ds) Create a new Workspace wrapping a GeoTools DataStore |
Workspace() Create a new Workspace with an in Memory Workspace |
Workspace(Map params) Create a new Workspace from a Map of parameters. |
Workspace(java.lang.String paramString) Create a new Workspace from a parameter string. |
Type Params | Return Type | Name and description |
---|---|---|
|
Layer |
add(Layer layer) Add a Layer to the Workspace |
|
Layer |
add(Layer layer, java.lang.String name, int chunk) Add a Layer as a name to the Workspace |
|
void |
close() Closes the Workspace by disposing of any resources. |
|
Layer |
create(java.lang.String name, java.util.List<Field> fields) Create a Layer with a List of Fields |
|
Layer |
create(Schema schema) Create a Layer with a Schema |
|
Layer |
get(java.lang.String name) Get a Layer by name |
|
Layer |
getAt(java.lang.String name) Another way to get a Layer by name. |
|
java.lang.String |
getFormat() Get the format |
|
java.util.List<Layer> |
getLayers() Get a List of Layers |
|
java.util.List<java.lang.String> |
getNames() Get a List of Layer names |
|
static Map |
getParameters(java.lang.String str) Get a connection map from a connection string |
|
Style |
getStyle(Layer layer, java.lang.String name) Get a Style for a Layer |
|
static Workspace |
getWorkspace(java.lang.String paramString) Get a Workspace from a parameter string |
|
static Workspace |
getWorkspace(Map params) Get a Workspace from a connection parameter Map |
|
static java.util.List |
getWorkspaceNames() Get a List of available GeoTools workspaces (aka DataStores) |
|
static java.util.List |
getWorkspaceParameters(java.lang.String name) Get the list of connection parameters for the given workspace |
|
boolean |
has(java.lang.String name) Whether the Workspace has a Layer by the given name |
|
protected FeatureCollection |
readFeatures(Cursor cursor, Schema schema, int chunk) Read Features from a Cursor in Batches. |
|
void |
remove(java.lang.String name) Remove a Layer by name from this Workspace |
|
void |
remove(Layer layer) Remove a Layer by name from this Workspace |
|
static void |
withWorkspace(java.lang.String paramString, groovy.lang.Closure closure) Use a Workspace within the Closure. |
|
static void |
withWorkspace(Map params, groovy.lang.Closure closure) Use a Workspace within the Closure. |
|
static void |
withWorkspace(Workspace workspace, groovy.lang.Closure closure) Use a Workspace within the Closure. |
|
static Workspace |
wrap(DataStore ds) Wrap a GeoTools DataStore in the appropriate GeoScript Workspace |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The GeoTools DataStore
Create a new Workspace wrapping a GeoTools DataStore
The
- GeoTools DataStoreCreate a new Workspace with an in Memory Workspace
Create a new Workspace from a Map of parameters.
params
- The Map of parametersCreate a new Workspace from a parameter string. The parameter string is space delimited collection of key=value parameters. If the key or value contains spaces they must be single quoted.
paramString
- The parameter string.Add a Layer to the Workspace
layer
- The Layer to addAdd a Layer as a name to the Workspace
layer
- The Layer to addname
- The new name of the Layerchunk
- The number of Features to add in one batchCloses the Workspace by disposing of any resources.
Create a Layer with a List of Fields
name
- The new Layer namefields
- A List of Fields (defaults to a "geom", "Geometry" Field)Create a Layer with a Schema
schema
- The Schema (defaults to a Schema with a single Geometry Field
named "geom"Get a Layer by name
The
- Layer nameAnother way to get a Layer by name.
Layer layer = workspace["hospitals"]
The
- Layer nameGet the format
Get a List of Layers
Get a List of Layer names
Get a connection map from a connection string
str
- The connection stringGet a Style for a Layer
layer
- The Layername
- The optional Style nameGet a Workspace from a parameter string
paramString
- The parameter stringGet a Workspace from a connection parameter Map
params
- The Map of connection parametersGet a List of available GeoTools workspaces (aka DataStores)
Get the list of connection parameters for the given workspace
name
- The workspace nameWhether the Workspace has a Layer by the given name
name
- The Layer nameRead Features from a Cursor in Batches.
cursor
- The Cursorschema
- The output Schemachunk
- The number of Features to be readRemove a Layer by name from this Workspace
name
- The Layer nameRemove a Layer by name from this Workspace
name
- The Layer nameUse a Workspace within the Closure. The Workspace will be closed.
paramString
- The param stringclosure
- The Closure that gets the opened WorkspaceUse a Workspace within the Closure. The Workspace will be closed.
params
- The parameter Mapclosure
- The Closure that gets the opened WorkspaceUse a Workspace within the Closure. The Workspace will be closed.
workspace
- The Workspaceclosure
- The Closure that gets the WorkspaceGroovy Documentation