The Writer allows for adding batches of Features to a Layer within a Transaction.
Writer writer = new Writer(layer, batch: 1000, transaction: 'default') try { Feature f = writer.newFeature writer.add(f) } finally { writer.close() }
Type Params | Return Type | Name and description |
---|---|---|
|
void |
add(Feature feature) Add a Feature |
|
void |
close() Closes the writing session. |
|
Feature |
getNewFeature() Get a new Feature with default values |
|
static void |
write(Map options = [:], Layer layer, groovy.lang.Closure c) Write batches of Features to the Layer |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), 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() |
Create a new Writer for a Layer.
options
- The named parameters
layer
- The Layer to write toAdd a Feature
feature
- The Feature to addCloses the writing session. If there are unwritten Features in the cache, they are written before the Transaction is finally closed.
Get a new Feature with default values
Write batches of Features to the Layer
options
- The named parameters
layer
- The Layer to write toc
- The Cursor which takes the Writer