|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAbstractDataStoreFactory
ShapefileDataStoreFactory
public class ShapefileDataStoreFactory
Builds instances of the shapefile data store
Nested Class Summary | |
---|---|
static class |
ShapefileDataStoreFactory.ShpFileStoreFactory
A delegates that allow to build a directory of shapfiles store |
Nested classes/interfaces inherited from interface DataAccessFactory |
---|
DataAccessFactory.Param |
Field Summary | |
---|---|
static DataAccessFactory.Param |
CACHE_MEMORY_MAPS
Optional - enable/disable the use of memory-mapped io |
static DataAccessFactory.Param |
CREATE_SPATIAL_INDEX
Optional - Enable/disable the automatic creation of spatial index |
static DataAccessFactory.Param |
DBFCHARSET
Optional - character used to decode strings from the DBF file |
static DataAccessFactory.Param |
DBFTIMEZONE
Optional - timezone to decode dates from the DBF file |
static DataAccessFactory.Param |
ENABLE_SPATIAL_INDEX
Optional - enable spatial index for local files |
static DataAccessFactory.Param |
FILE_TYPE
Optional - discriminator for directory stores |
static DataAccessFactory.Param |
FSTYPE
Optional parameter used to indicate 'shape-ng' (as a marker to select the implementation of DataStore to use). |
static DataAccessFactory.Param |
MEMORY_MAPPED
Optional - enable/disable the use of memory-mapped io |
static DataAccessFactory.Param |
NAMESPACEP
Optional - uri of the FeatureType's namespace |
static DataAccessFactory.Param |
URLP
url to the .shp file. |
Constructor Summary | |
---|---|
ShapefileDataStoreFactory()
|
Method Summary | |
---|---|
boolean |
canProcess(Map params)
Default implementation verifies the Map against the Param information. |
boolean |
canProcess(URL f)
Tests if the provided url can be handled by this factory. |
DataStore |
createDataStore(Map<String,Serializable> params)
Construct a live data source using the params specifed. |
FileDataStore |
createDataStore(URL url)
A DataStore attached to the provided url, may be created if needed. |
DataStore |
createNewDataStore(Map<String,Serializable> params)
|
String |
getDescription()
Describe the nature of the datasource constructed by this factory. |
String |
getDisplayName()
Default Implementation abuses the naming convention. |
String[] |
getFileExtensions()
The list of filename extentions handled by this factory. |
Map<RenderingHints.Key,?> |
getImplementationHints()
Returns the implementation hints. |
DataAccessFactory.Param[] |
getParametersInfo()
MetaData about the required Parameters (for createDataStore). |
String |
getTypeName(URL url)
The typeName represented by the provided url. |
boolean |
isAvailable()
Defaults to true, only a few datastores need to check for drivers. |
Methods inherited from class AbstractDataStoreFactory |
---|
getParameters |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final DataAccessFactory.Param URLP
public static final DataAccessFactory.Param NAMESPACEP
public static final DataAccessFactory.Param MEMORY_MAPPED
public static final DataAccessFactory.Param CACHE_MEMORY_MAPS
public static final DataAccessFactory.Param FILE_TYPE
public static final DataAccessFactory.Param CREATE_SPATIAL_INDEX
public static final DataAccessFactory.Param DBFCHARSET
public static final DataAccessFactory.Param FSTYPE
public static final DataAccessFactory.Param DBFTIMEZONE
public static final DataAccessFactory.Param ENABLE_SPATIAL_INDEX
Constructor Detail |
---|
public ShapefileDataStoreFactory()
Method Detail |
---|
public String getDisplayName()
AbstractDataStoreFactory
Will return Foo
for
org.geotools.data.foo.FooFactory
.
getDisplayName
in interface DataAccessFactory
getDisplayName
in class AbstractDataStoreFactory
public String getDescription()
DataAccessFactory
A non localized description of this data store type.
getDescription
in interface DataAccessFactory
public DataAccessFactory.Param[] getParametersInfo()
DataAccessFactory
Interpretation of FeatureDescriptor values:
This should be the same as:
Object params = factory.getParameters();
BeanInfo info = getBeanInfo( params );
return info.getPropertyDescriptors();
getParametersInfo
in interface DataAccessFactory
public boolean isAvailable()
AbstractDataStoreFactory
isAvailable
in interface DataAccessFactory
isAvailable
in class AbstractDataStoreFactory
true
, override to check for drivers etc...public Map<RenderingHints.Key,?> getImplementationHints()
AbstractDataStoreFactory
getImplementationHints
in interface Factory
getImplementationHints
in class AbstractDataStoreFactory
public DataStore createDataStore(Map<String,Serializable> params) throws IOException
DataStoreFactorySpi
You can think of this as setting up a connection to the back end data source.
Magic Params: the following params are magic and are honoured by convention by the GeoServer and uDig application.
createDataStore
in interface DataAccessFactory
createDataStore
in interface DataStoreFactorySpi
params
- The full set of information needed to construct a live
data store. Typical key values for the map include: url -
location of a resource, used by file reading datasources. dbtype
- the type of the database to connect to, e.g. postgis, mysql
IOException
- if there were any problems setting up (creating or
connecting) the datasource.public DataStore createNewDataStore(Map<String,Serializable> params) throws IOException
createNewDataStore
in interface DataStoreFactorySpi
IOException
public boolean canProcess(Map params)
AbstractDataStoreFactory
It will ensure that:
Why would you ever want to override this method? If you want to check that a expected file exists and is a directory.
Overrride:
public boolean canProcess( Map params ) {
if( !super.canProcess( params ) ){
return false; // was not in agreement with getParametersInfo
}
// example check
File file = (File) DIRECTORY.lookup( params ); // DIRECTORY is a param
return file.exists() && file.isDirectory();
}
canProcess
in interface DataAccessFactory
canProcess
in class AbstractDataStoreFactory
params
- The full set of information needed to construct a live
data source.
public boolean canProcess(URL f)
FileDataStoreFactorySpi
canProcess
in interface FileDataStoreFactorySpi
f
- URL to a real file (may not be local)
true
if this url can when this dataStore can resolve and read the data specifiedpublic String[] getFileExtensions()
FileDataStoreFactorySpi
getFileExtensions
in interface FileDataStoreFactorySpi
public FileDataStore createDataStore(URL url) throws IOException
FileDataStoreFactorySpi
Please note that additional configuration options may be available via the traditional createDataStore( Map ) method provided by the superclass.
createDataStore
in interface FileDataStoreFactorySpi
url
- The data location for the
IOException
AbstractFileDataStore
public String getTypeName(URL url) throws IOException
FileDataStoreFactorySpi
getTypeName
in interface FileDataStoreFactorySpi
url
- The location of the datum to parse into features
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |