|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectContentDataStore
ShapefileDataStore
public class ShapefileDataStore
Field Summary | |
---|---|
static Charset |
DEFAULT_STRING_CHARSET
|
static TimeZone |
DEFAULT_TIMEZONE
|
static String |
ORIGINAL_FIELD_DUPLICITY_COUNT
|
static String |
ORIGINAL_FIELD_NAME
|
protected static Boolean |
TRACE_ENABLED
When true, the stack trace that got a lock that wasn't released is recorded and then printed out when warning the user about this. |
Fields inherited from class ContentDataStore |
---|
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, lockingManager, LOGGER, namespaceURI, typeFactory, WRITER_ADD, WRITER_UPDATE |
Constructor Summary | |
---|---|
ShapefileDataStore(URL url)
|
Method Summary | |
---|---|
protected static DbaseFileHeader |
createDbaseHeader(SimpleFeatureType featureType)
Attempt to create a DbaseFileHeader for the FeatureType. |
protected ContentFeatureSource |
createFeatureSource(ContentEntry entry)
Instantiates new feature source for the entry. |
void |
createSchema(SimpleFeatureType featureType)
Set the FeatureType of this DataStore. |
protected List<Name> |
createTypeNames()
Creates a set of qualified names corresponding to the types that the datastore provides. |
void |
dispose()
Disposes of this data store and releases any resource that it is using. |
protected void |
finalize()
|
void |
forceSchemaCRS(CoordinateReferenceSystem crs)
This method is used to force the creation of a .prj file. |
Charset |
getCharset()
|
long |
getCount(Query query)
|
FeatureReader<SimpleFeatureType,SimpleFeature> |
getFeatureReader()
|
ContentFeatureSource |
getFeatureSource()
|
FeatureWriter<SimpleFeatureType,SimpleFeature> |
getFeatureWriter(Filter filter,
Transaction transaction)
|
FeatureWriter<SimpleFeatureType,SimpleFeature> |
getFeatureWriter(Transaction transaction)
|
FeatureWriter<SimpleFeatureType,SimpleFeature> |
getFeatureWriterAppend(Transaction transaction)
|
SimpleFeatureType |
getSchema()
FeatureType for the file being read. |
TimeZone |
getTimeZone()
|
boolean |
isBufferCachingEnabled()
|
boolean |
isFidIndexed()
Returns true if the store uses the .fix index file for feature ids. |
boolean |
isIndexCreationEnabled()
|
boolean |
isIndexed()
|
boolean |
isMemoryMapped()
|
void |
setBufferCachingEnabled(boolean bufferCachingEnabled)
|
void |
setCharset(Charset charset)
|
void |
setFidIndexed(boolean fidIndexed)
Enables/disables the feature id index. |
void |
setIndexCreationEnabled(boolean indexCreationEnabled)
If true (default) the index file will be created on demand if missing |
void |
setIndexed(boolean indexed)
When set to true, will use the spatial index if available (but will not create it if missing, unless also indexCreationEnabled is true) |
void |
setMemoryMapped(boolean memoryMapped)
|
void |
setTimeZone(TimeZone timeZone)
|
String |
toString()
|
void |
updateSchema(SimpleFeatureType featureType)
|
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface DataStore |
---|
getFeatureReader, getFeatureSource, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getSchema, getTypeNames, removeSchema, updateSchema |
Methods inherited from interface DataAccess |
---|
getInfo, getNames, getSchema, removeSchema, updateSchema |
Field Detail |
---|
public static final String ORIGINAL_FIELD_NAME
public static final String ORIGINAL_FIELD_DUPLICITY_COUNT
public static final Charset DEFAULT_STRING_CHARSET
public static final TimeZone DEFAULT_TIMEZONE
protected static final Boolean TRACE_ENABLED
Constructor Detail |
---|
public ShapefileDataStore(URL url)
Method Detail |
---|
protected List<Name> createTypeNames() throws IOException
ContentDataStore
Namespaces may be left null
for data stores which do not
support namespace qualified type names.
createTypeNames
in class ContentDataStore
Name
.
IOException
- Any errors occuring connecting to data.protected ContentFeatureSource createFeatureSource(ContentEntry entry) throws IOException
ContentDataStore
Subclasses should override this method to return a specific subclass of
ContentFeatureSource
.
createFeatureSource
in class ContentDataStore
entry
- The entry.
ContentFeatureSource
for the entry.
IOException
public ContentFeatureSource getFeatureSource() throws IOException
getFeatureSource
in interface FileDataStore
IOException
DataStore.getFeatureSource(java.lang.String)
public Charset getCharset()
public void setCharset(Charset charset)
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
public boolean isMemoryMapped()
public void setMemoryMapped(boolean memoryMapped)
public boolean isBufferCachingEnabled()
public void setBufferCachingEnabled(boolean bufferCachingEnabled)
public boolean isIndexed()
public void setIndexed(boolean indexed)
indexed
- public SimpleFeatureType getSchema() throws IOException
FileDataStore
This is the same as getSchema( getTypeName[0] )
getSchema
in interface FileDataStore
IOException
DataStore.getSchema(java.lang.String)
public FeatureReader<SimpleFeatureType,SimpleFeature> getFeatureReader() throws IOException
getFeatureReader
in interface FileDataStore
IOException
org.geotools.data.DataStore#getFeatureReader(java.lang.String)
public long getCount(Query query) throws IOException
IOException
public void createSchema(SimpleFeatureType featureType) throws IOException
createSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
createSchema
in class ContentDataStore
featureType
- The desired FeatureType.
IOException
- If the DataStore is remote.DataAccess.createSchema(FeatureType)
protected static DbaseFileHeader createDbaseHeader(SimpleFeatureType featureType) throws IOException, DbaseFileException
featureType
- DOCUMENT ME!
IOException
- DOCUMENT ME!
DbaseFileException
- DOCUMENT ME!public void forceSchemaCRS(CoordinateReferenceSystem crs) throws IOException
The internally cached FeatureType will be removed, so the next call to getSchema() will read in the created file. This method is not thread safe and will have dire consequences for any other thread making use of the shapefile.
crs
-
IOException
public void dispose()
DataAccess
A DataStore
cannot be used after dispose
has
been called, neither can any data access object it helped create, such
as FeatureReader
, FeatureSource
or FeatureCollection
.
This operation can be called more than once without side effects.
There is no thread safety assurance associated with this method. For example, client code will have to make sure this method is not called while retrieving/saving data from/to the storage, or be prepared for the consequences.
dispose
in interface DataAccess<SimpleFeatureType,SimpleFeature>
dispose
in class ContentDataStore
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public boolean isFidIndexed()
public void setFidIndexed(boolean fidIndexed)
fidIndexed
- public String toString()
toString
in class Object
public void updateSchema(SimpleFeatureType featureType) throws IOException
updateSchema
in interface FileDataStore
IOException
DataStore.updateSchema(java.lang.String,SimpleFeatureType)
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(Filter filter, Transaction transaction) throws IOException
getFeatureWriter
in interface FileDataStore
IOException
org.geotools.data.DataStore#getFeatureWriter(Filter,Transaction)
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriter(Transaction transaction) throws IOException
getFeatureWriter
in interface FileDataStore
IOException
DataStore.getFeatureWriter(java.lang.String,
org.geotools.data.Transaction)
public FeatureWriter<SimpleFeatureType,SimpleFeature> getFeatureWriterAppend(Transaction transaction) throws IOException
getFeatureWriterAppend
in interface FileDataStore
IOException
DataStore.getFeatureWriterAppend(java.lang.String,
org.geotools.data.Transaction)
public boolean isIndexCreationEnabled()
public void setIndexCreationEnabled(boolean indexCreationEnabled)
indexCreationEnabled
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |