A Directory Workspace can contain one or more Shapefiles.
Directory dir = new Directory("shapefiles") Layer layer = dir.get("states")
Modifiers | Name | Description |
---|---|---|
static class |
Directory.Factory |
The Directory WorkspaceFactory |
Constructor and description |
---|
Directory
(java.io.File dir) Create a Directory Workspace from a File directory |
Directory
(java.lang.String dir) Create a Directory Workspace from a File directory |
Directory
(org.geotools.data.directory.DirectoryDataStore ds) Create a Directory Workspace from a GeoTools DirectoryDataStore |
Directory
(org.geotools.data.shapefile.ShapefileDataStore ds) Create a Directory Workspace from a GeoTools ShapefileDataStore |
Type | Name and description |
---|---|
static Directory |
fromURL(java.util.Map options = [:], java.net.URL url, java.io.File dir) Get a Directory from a zipped Shapefile |
Layer |
get(java.lang.String name) Get a Layer by name |
java.io.File |
getFile() Get the File or Directory |
java.lang.String |
getFormat() Get the format |
void |
remove(java.lang.String name) Remove a Layer by name from this Workspace |
java.lang.String |
toString() The string representation |
Methods inherited from class | Name |
---|---|
class Workspace |
add, add, close, create, create, get, getAt, getFormat, getLayers, getNames, getParameters, getWorkspace, getWorkspace, getWorkspaceNames, getWorkspaceParameters, has, readFeatures, remove, remove, withWorkspace, withWorkspace, withWorkspace, wrap |
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 Directory Workspace from a File directory
dir
- The File directoryCreate a Directory Workspace from a File directory
dir
- The File directory as a StringCreate a Directory Workspace from a GeoTools DirectoryDataStore
ds
- The GeoTools DirectoryDataStoreCreate a Directory Workspace from a GeoTools ShapefileDataStore
ds
- The GeoTools ShapefileDataStoreGet a Directory from a zipped Shapefile
options
- Optional named parameters:
url
- The URL of the zipped Shapefiledir
- The File directory where we will unzip the zip fileGet a Layer by name
The
- Layer nameGet the File or Directory
Get the format
Remove a Layer by name from this Workspace
name
- The Layer nameThe string representation