|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractDataStore
AbstractFileDataStore
ShapefileDataStore
IndexedShapefileDataStore
public class IndexedShapefileDataStore
A DataStore implementation which allows reading and writing from Shapefiles.
Field Summary |
---|
Fields inherited from class ShapefileDataStore |
---|
dbfCharset, DEFAULT_STRING_CHARSET, namespace, schema, shpFiles, useMemoryMappedBuffer |
Fields inherited from class AbstractDataStore |
---|
isWriteable, listenerManager, LOGGER |
Constructor Summary | |
---|---|
IndexedShapefileDataStore(URL url)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(URL url,
boolean useMemoryMappedBuffer,
boolean createIndex)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(URL url,
URI namespace)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(URL url,
URI namespace,
boolean useMemoryMappedBuffer,
boolean createIndex,
IndexType treeType)
Creates a new instance of ShapefileDataStore. |
|
IndexedShapefileDataStore(URL url,
URI namespace,
boolean useMemoryMappedBuffer,
boolean createIndex,
IndexType treeType,
Charset dbfCharset)
Creates a new instance of ShapefileDataStore. |
Method Summary | |
---|---|
void |
buildQuadTree()
Builds the QuadTree index. |
protected FeatureReader<SimpleFeatureType,SimpleFeature> |
createFeatureReader(String typeName,
IndexedShapefileAttributeReader r,
SimpleFeatureType readerSchema)
|
protected FeatureWriter<SimpleFeatureType,SimpleFeature> |
createFeatureWriter(String typeName,
Transaction transaction)
Create a FeatureWriter for the given type name. |
void |
createSpatialIndex()
Forces the spatial index to be created |
SimpleFeatureType |
createSubType(String[] properties)
Much like DataUtilities.createSubType(SimpleFeatureType, String[]) , but makes
sure to preserve the original attribute order |
void |
generateFidIndex()
Forces the FID index to be regenerated |
protected IndexedShapefileAttributeReader |
getAttributesReader(boolean readDbf,
boolean readGeometry,
Query query,
SimpleFeatureType targetSchema)
Returns the attribute reader, allowing for a pure shape reader, or a combined dbf/shp reader. |
protected ReferencedEnvelope |
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 FeatureReader<SimpleFeatureType,SimpleFeature> |
getFeatureReader(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. |
FeatureWriter<SimpleFeatureType,SimpleFeature> |
getFeatureWriterAppend(String typeName,
Transaction transaction)
Aquire a FeatureWriter for adding new content to a FeatureType. |
protected Set |
getSupportedHints()
If you are using the automated FeatureSource/Store/Locking creation, this method allows for the specification of the supported hints. |
protected Filter |
getUnsupportedFilter(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. |
String |
id()
An id for the reader. |
boolean |
indexUseable(ShpFileType indexType)
Returns true if the index for the given type exists and is useable. |
boolean |
isIndexed()
Returns true if the indices already exist and do not need to be regenerated or cannot be generated (IE isn't local). |
boolean |
isMemoryMapped()
|
protected DbaseFileReader |
openDbfReader()
Convenience method for opening a DbaseFileReader. |
protected QuadTree |
openQuadTree()
Convenience method for opening a QuadTree index. |
protected CloseableCollection<Data> |
queryQuadTree(Envelope bbox)
QuadTree Query |
protected TransactionStateDiff |
state(Transaction transaction)
This method is identical to the super class WHY? |
Methods inherited from class AbstractFileDataStore |
---|
getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, updateSchema |
Methods inherited from class AbstractDataStore |
---|
createLockingManager, getFeatureReader, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriter, getLockingManager, getNames, getSchema, getView, updateSchema, updateSchema |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface DataStore |
---|
getFeatureReader, getFeatureWriter, getFeatureWriter, getLockingManager, getView, updateSchema |
Methods inherited from interface DataAccess |
---|
getFeatureSource, getNames, getSchema, updateSchema |
Constructor Detail |
---|
public IndexedShapefileDataStore(URL url) throws MalformedURLException
url
- The URL of the shp file to use for this DataSource.
MalformedURLException
public IndexedShapefileDataStore(URL url, URI namespace) throws MalformedURLException
url
- The URL of the shp file to use for this DataSource.namespace
- DOCUMENT ME!
MalformedURLException
public IndexedShapefileDataStore(URL url, boolean useMemoryMappedBuffer, boolean createIndex) throws 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 needed
MalformedURLException
public IndexedShapefileDataStore(URL url, URI namespace, boolean useMemoryMappedBuffer, boolean createIndex, IndexType treeType) throws 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
- The type of index to use
MalformedURLException
public IndexedShapefileDataStore(URL url, URI namespace, boolean useMemoryMappedBuffer, boolean createIndex, IndexType treeType, Charset dbfCharset) throws 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
- The type of index useddbfCharset
- Charset
used to decode strings from the DBF
NullPointerException
- DOCUMENT ME!
.
MalformedURLException
Method Detail |
---|
public void createSpatialIndex() throws IOException
IOException
protected Filter getUnsupportedFilter(String typeName, Filter filter)
AbstractDataStore
If the complete filter is supported, the subclass must return Filter.INCLUDE
getUnsupportedFilter
in class AbstractDataStore
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriterAppend(String typeName, Transaction transaction) throws 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
typeName
- Indicates featureType to be modifiedtransaction
- Transaction to operates against
IOException
protected TransactionStateDiff state(Transaction transaction)
state
in class AbstractDataStore
protected FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader(String typeName, Query query) throws IOException
getFeatureReader
in class ShapefileDataStore
IOException
AbstractDataStore.getFeatureReader(java.lang.String,
org.geotools.data.Query)
public SimpleFeatureType createSubType(String[] properties) throws SchemaException
DataUtilities.createSubType(SimpleFeatureType, String[])
, but makes
sure to preserve the original attribute order
properties
-
SchemaException
protected FeatureReader<SimpleFeatureType,SimpleFeature> createFeatureReader(String typeName, IndexedShapefileAttributeReader r, SimpleFeatureType readerSchema) throws SchemaException, IOException
SchemaException
IOException
public void generateFidIndex() throws IOException
IOException
protected IndexedShapefileAttributeReader getAttributesReader(boolean readDbf, boolean readGeometry, Query query, SimpleFeatureType targetSchema) throws IOException
readDbf
- -
if true, the dbf fill will be opened and readreadGeometry
- DOCUMENT ME!filter
- -
a Filter to use
IOException
public boolean indexUseable(ShpFileType indexType)
indexType
- the type of index to check
public boolean isIndexed()
protected CloseableCollection<Data> queryQuadTree(Envelope bbox) throws DataSourceException, IOException, TreeException
bbox
-
DataSourceException
IOException
TreeException
- DOCUMENT ME!protected DbaseFileReader openDbfReader() throws IOException
openDbfReader
in class ShapefileDataStore
IOException
- If an error occurs during creation.protected QuadTree openQuadTree() throws StoreException
StoreException
protected FeatureWriter<SimpleFeatureType,SimpleFeature> createFeatureWriter(String typeName, Transaction transaction) throws IOException
createFeatureWriter
in class ShapefileDataStore
typeName
- The typeName of the FeatureType to writetransaction
- DOCUMENT ME!
IOException
- If the typeName is not available or some other error
occurs.protected ReferencedEnvelope getBounds(Query query) throws 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
SchemaNotFoundException
IOException
AbstractDataStore.getBounds(org.geotools.data.Query)
public void buildQuadTree() throws TreeException
TreeException
public boolean isMemoryMapped()
public String id()
FileReader
id
in interface FileReader
id
in interface FileWriter
protected Set getSupportedHints()
AbstractDataStore
getSupportedHints
in class ShapefileDataStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |