public class OGRDataStore extends ContentDataStore
dataStoreFactory, entries, featureFactory, filterFactory, geometryFactory, JOINED_FEATURE_TYPE, lockingManager, LOGGER, namespaceURI, typeFactory, WRITER_ADD, WRITER_COMMIT, WRITER_UPDATE
Constructor and Description |
---|
OGRDataStore(String ogrName,
String ogrDriver,
URI namespace,
OGR ogr) |
OGRDataStore(String ogrName,
String ogrDriver,
URI namespace,
OGR ogr,
OGRDataSourcePool dataSourcePool) |
Modifier and Type | Method and Description |
---|---|
protected ContentFeatureSource |
createFeatureSource(ContentEntry entry)
Instantiates new feature source for the entry.
|
void |
createSchema(SimpleFeatureCollection data,
boolean approximateFields,
String[] options)
Creates a new OGR layer with provided data and options.
|
void |
createSchema(SimpleFeatureType schema)
Creates a new schema in the datastore.
|
void |
createSchema(SimpleFeatureType schema,
boolean approximateFields,
String[] options)
Creates a new OGR layer with provided schema and options
|
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.
|
boolean |
supportsInPlaceWrite(String typeName) |
createContentState, ensureEntry, ensureFeatureStore, entry, getDataStoreFactory, getEntry, getFeatureFactory, getFeatureReader, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureSource, getFeatureTypeFactory, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getFilterFactory, getGeometryFactory, getInfo, getLockingManager, getLogger, getNames, getNamespaceURI, getSchema, getSchema, getTypeNames, name, removeEntry, removeSchema, removeSchema, setDataStoreFactory, setFeatureFactory, setFeatureTypeFactory, setFilterFactory, setGeometryFactory, setNamespaceURI, updateSchema, updateSchema
public OGRDataStore(String ogrName, String ogrDriver, URI namespace, OGR ogr, OGRDataSourcePool dataSourcePool)
public OGRDataStore(String ogrName, String ogrDriver, URI namespace, OGR ogr) throws IOException
IOException
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 boolean supportsInPlaceWrite(String typeName) throws IOException
IOException
public void createSchema(SimpleFeatureType schema) throws IOException
ContentDataStore
This implementation throws aUnsupportedOperationException
. Subclasses should
override to support schema creation.
createSchema
in interface DataAccess<SimpleFeatureType,SimpleFeature>
createSchema
in class ContentDataStore
schema
- FetureType to add to DataStoreIOException
- If featureType cannot be createdDataAccess.createSchema(FeatureType)
public void createSchema(SimpleFeatureType schema, boolean approximateFields, String[] options) throws IOException
schema
- the geotools schemaapproximateFields
- if true, OGR will try to create fields that are approximations of
the required ones when an exact match cannt be providedoptions
- OGR data source/layer creation optionsIOException
public void createSchema(SimpleFeatureCollection data, boolean approximateFields, String[] options) throws IOException
data
- The data to fill into the newly created layerapproximateFields
- if true, OGR will try to create fields that are approximations of
the required ones when an exact match cannt be providedoptions
- OGR data source/layer creation optionsIOException
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
Copyright © 1996–2022 Geotools. All rights reserved.