|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.AbstractDataStore org.geotools.data.AbstractFileDataStore org.geotools.data.shapefile.ShapefileDataStore org.geotools.data.shapefile.indexed.IndexedShapefileDataStore
A DataStore implementation which allows reading and writing from Shapefiles.
Nested Class Summary | |
protected static class |
IndexedShapefileDataStore.Reader
An AttributeReader implementation for shape. |
protected class |
IndexedShapefileDataStore.Writer
A FeatureWriter for ShapefileDataStore. |
Field Summary | |
java.net.URL |
fixURL
|
static byte |
TREE_GRX
|
static byte |
TREE_NONE
|
static byte |
TREE_QIX
|
Fields inherited from class org.geotools.data.shapefile.ShapefileDataStore |
dbfURL, namespace, prjURL, readWriteLock, schema, shpURL, shxURL, useMemoryMappedBuffer, xmlURL |
Fields inherited from class org.geotools.data.AbstractDataStore |
isWriteable, listenerManager, LOGGER |
Constructor Summary | |
IndexedShapefileDataStore(java.net.URL url)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(java.net.URL url,
boolean useMemoryMappedBuffer)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(java.net.URL url,
boolean useMemoryMappedBuffer,
boolean createIndex)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(java.net.URL url,
java.net.URI namespace)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(java.net.URL url,
java.net.URI namespace,
boolean useMemoryMappedBuffer)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(java.net.URL url,
java.net.URI namespace,
boolean useMemoryMappedBuffer,
boolean createIndex,
byte treeType)
Creates a new instance of ShapefileDataStore. |
Method Summary | |
protected FeatureReader |
createFeatureReader(java.lang.String typeName,
IndexedShapefileDataStore.Reader r,
FeatureType readerSchema)
DOCUMENT ME! |
protected java.lang.String |
createFeatureTypeName()
Create the type name of the single FeatureType this DataStore represents. |
protected FeatureWriter |
createFeatureWriter(java.lang.String typeName,
Transaction transaction)
Create a FeatureWriter for the given type name. |
protected void |
finalize()
|
protected IndexedShapefileDataStore.Reader |
getAttributesReader(boolean readDbf,
boolean readGeometry,
Filter filter)
Returns the attribute reader, allowing for a pure shape reader, or a combined dbf/shp reader. |
protected com.vividsolutions.jts.geom.Envelope |
getBounds(Query query)
Computes the bounds of the features for the specified feature type that satisfy the query provided that there is a fast way to get that result. |
protected int |
getCount(Query query)
Gets the number of the features that would be returned by this query for the specified feature type. |
protected java.lang.String |
getCurrentTypeName()
|
protected FeatureReader |
getFeatureReader(java.lang.String typeName,
Query query)
Use the spatial index if available and adds a small optimization: if no attributes are going to be read, don't uselessly open and read the dbf file. |
FeatureSource |
getFeatureSource(java.lang.String typeName)
Default implementation based on getFeatureReader and getFeatureWriter. |
FeatureWriter |
getFeatureWriterAppend(java.lang.String typeName,
Transaction transaction)
Aquire a FeatureWriter for adding new content to a FeatureType. |
FeatureType |
getSchema()
Singular version, returns the FeatureType for the url being read. |
FeatureType |
getSchema(java.lang.String typeName)
Obtain the FeatureType of the given name. |
java.lang.String[] |
getTypeNames()
Get an array of type names this DataStore holds. |
protected Filter |
getUnsupportedFilter(java.lang.String typeName,
Filter filter)
GR: if a subclass supports filtering, it should override this method to return the unsupported part of the passed filter, so a FilteringFeatureReader will be constructed upon it. |
boolean |
isLocal()
Determine if the location of this shape is local or remote. |
boolean |
isMemoryMapped()
|
protected DbaseFileReader |
openDbfReader()
Convenience method for opening a DbaseFileReader. |
protected IndexFile |
openIndexFile()
Convenience method for opening a ShapefileReader. |
protected QuadTree |
openQuadTree()
Convenience method for opening a QuadTree index. |
protected RTree |
openRTree()
Convenience method for opening an RTree index. |
protected AttributeType[] |
readAttributes()
Create the AttributeTypes contained within this DataStore. |
protected void |
typeCheck(java.lang.String requested)
A convenience method to check if a type name is correct. |
Methods inherited from class org.geotools.data.shapefile.ShapefileDataStore |
copyAndDelete, createDbaseHeader, createFeatureReader, createMetadata, createSchema, getAttributesReader, getFeatureReader, getFeatureReader, getReadChannel, getStorageFile, getStorageURL, getWriteChannel, openPrjReader, openShapeReader |
Methods inherited from class org.geotools.data.AbstractFileDataStore |
getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, updateSchema |
Methods inherited from class org.geotools.data.AbstractDataStore |
createLockingManager, getFeatureReader, getFeatureWriter, getFeatureWriter, getFeatureWriter, getLockingManager, getView, updateSchema |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte TREE_NONE
public static final byte TREE_GRX
public static final byte TREE_QIX
public java.net.URL fixURL
Constructor Detail |
public IndexedShapefileDataStore(java.net.URL url) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.public IndexedShapefileDataStore(java.net.URL url, java.net.URI namespace) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.namespace
- DOCUMENT ME!public IndexedShapefileDataStore(java.net.URL url, java.net.URI namespace, boolean useMemoryMappedBuffer) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.namespace
- DOCUMENT ME!useMemoryMappedBuffer
- enable/disable memory mapping of filespublic IndexedShapefileDataStore(java.net.URL url, boolean useMemoryMappedBuffer) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.useMemoryMappedBuffer
- enable/disable memory mapping of filespublic IndexedShapefileDataStore(java.net.URL url, boolean useMemoryMappedBuffer, boolean createIndex) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.useMemoryMappedBuffer
- enable/disable memory mapping of filescreateIndex
- enable/disable automatic index creation if neededpublic IndexedShapefileDataStore(java.net.URL url, java.net.URI namespace, boolean useMemoryMappedBuffer, boolean createIndex, byte treeType) throws java.net.MalformedURLException
url
- The URL of the shp file to use for this DataSource.namespace
- DOCUMENT ME!useMemoryMappedBuffer
- enable/disable memory mapping of filescreateIndex
- enable/disable automatic index creation if neededtreeType
- DOCUMENT ME!
java.lang.NullPointerException
- DOCUMENT ME!
.
java.net.MalformedURLException
Method Detail |
protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public boolean isLocal()
isLocal
in class ShapefileDataStore
protected Filter getUnsupportedFilter(java.lang.String typeName, Filter filter)
AbstractDataStore
If the complete filter is supported, the subclass must return Filter.NONE
getUnsupportedFilter
in class AbstractDataStore
public FeatureWriter getFeatureWriterAppend(java.lang.String typeName, Transaction transaction) throws java.io.IOException
DataStore
This FeatureWriter will return false
for hasNext(), however
next() may be used to aquire new Features that may be writen out to add
new content.
getFeatureWriterAppend
in interface DataStore
getFeatureWriterAppend
in class AbstractDataStore
java.io.IOException
protected FeatureReader getFeatureReader(java.lang.String typeName, Query query) throws java.io.IOException
getFeatureReader
in class ShapefileDataStore
java.io.IOException
AbstractDataStore.getFeatureReader(java.lang.String,
org.geotools.data.Query)
protected FeatureReader createFeatureReader(java.lang.String typeName, IndexedShapefileDataStore.Reader r, FeatureType readerSchema) throws SchemaException, java.io.IOException
typeName
- r
- readerSchema
-
SchemaException
java.io.IOException
protected IndexedShapefileDataStore.Reader getAttributesReader(boolean readDbf, boolean readGeometry, Filter filter) throws java.io.IOException
readDbf
- -
if true, the dbf fill will be opened and readreadGeometry
- DOCUMENT ME!filter
- -
a Filter to use
java.io.IOException
protected IndexFile openIndexFile() throws java.io.IOException
java.io.IOException
protected DbaseFileReader openDbfReader() throws java.io.IOException
openDbfReader
in class ShapefileDataStore
java.io.IOException
- If an error occurs during creation.protected RTree openRTree() throws java.io.IOException
java.io.IOException
- If an error occurs during creation.
DataSourceException
- DOCUMENT ME!protected QuadTree openQuadTree() throws StoreException
StoreException
public java.lang.String[] getTypeNames()
getTypeNames
in interface DataStore
getTypeNames
in class ShapefileDataStore
protected java.lang.String createFeatureTypeName()
createFeatureTypeName
in class ShapefileDataStore
protected java.lang.String getCurrentTypeName()
getCurrentTypeName
in class ShapefileDataStore
protected void typeCheck(java.lang.String requested) throws java.io.IOException
typeCheck
in class ShapefileDataStore
requested
- The type name requested.
java.io.IOException
- If the type name is not availableprotected FeatureWriter createFeatureWriter(java.lang.String typeName, Transaction transaction) throws java.io.IOException
createFeatureWriter
in class ShapefileDataStore
typeName
- The typeName of the FeatureType to writetransaction
- DOCUMENT ME!
java.io.IOException
- If the typeName is not available or some other error occurs.public FeatureType getSchema(java.lang.String typeName) throws java.io.IOException
getSchema
in interface DataStore
getSchema
in class ShapefileDataStore
typeName
- The name of the FeatureType.
java.io.IOException
- If a type by the requested name is not present.public FeatureType getSchema() throws java.io.IOException
AbstractFileDataStore
getSchema
in class ShapefileDataStore
java.io.IOException
protected AttributeType[] readAttributes() throws java.io.IOException
readAttributes
in class ShapefileDataStore
java.io.IOException
- If AttributeType reading failsprotected com.vividsolutions.jts.geom.Envelope getBounds(Query query) throws java.io.IOException
AbstractDataStore
Will return null if there is not fast way to compute the bounds. Since it's based on some kind of header/cached information, it's not guaranteed to be real bound of the features
getBounds
in class ShapefileDataStore
java.io.IOException
AbstractDataStore.getBounds(org.geotools.data.Query)
public FeatureSource getFeatureSource(java.lang.String typeName) throws java.io.IOException
AbstractDataStore
We should be able to optimize this to only get the RowSet once
getFeatureSource
in interface DataStore
getFeatureSource
in class ShapefileDataStore
java.io.IOException
DataStore.getFeatureSource(java.lang.String)
protected int getCount(Query query) throws java.io.IOException
AbstractDataStore
If getBounds(Query) returns -1
due to expense consider
using getFeatures(Query).getCount()
as a an alternative.
getCount
in class ShapefileDataStore
java.io.IOException
AbstractDataStore.getCount(org.geotools.data.Query)
public boolean isMemoryMapped()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |