|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.shapefile.ShapefileDataStoreFactory
public class ShapefileDataStoreFactory
Implementation of the DataStore service provider interface for Shapefiles.
The specific implementation of ShapefileDataStore created by this class is not specified. For more information on the connection parameters please review the following public Param constants.
URLP
NAMESPACEP
CREATE_SPATIAL_INDEX
MEMORY_MAPPED
DBFCHARSET
Field Summary | |
---|---|
static Param |
CREATE_SPATIAL_INDEX
Optional - Enable/disable the automatic creation of spatial index |
static Param |
DBFCHARSET
Optional - character used to decode strings from the DBF file |
protected static Logger |
LOGGER
|
static Param |
MEMORY_MAPPED
Optional - enable/disable the use of memory-mapped io |
static Param |
NAMESPACEP
Optional - uri of the FeatureType's namespace |
static Param |
URLP
url to the .shp file. |
Constructor Summary | |
---|---|
ShapefileDataStoreFactory()
|
Method Summary | |
---|---|
boolean |
canProcess(Map params)
Takes a map of parameters which describes how to access a DataStore and determines if it can be read by the ShapefileDataStore or IndexedShapefileDataStore implementations. |
boolean |
canProcess(URL f)
|
DataStore |
createDataStore(Map params)
Returns an instance of DataStore iff the resource pointed to the Map of paramers can be handled as a shapefile. |
DataStore |
createDataStore(URL url)
We may need to create a new datastore if the provided file does not exist. |
DataStore |
createDataStore(URL url,
boolean memorymapped)
|
DataStore |
createNewDataStore(Map params)
Creates a new DataStore - for a file that does not exist yet. |
String |
getDescription()
Describes the type of data the datastore returned by this factory works with. |
String |
getDisplayName()
|
String[] |
getFileExtensions()
|
Map |
getImplementationHints()
Returns the implementation hints. |
Param[] |
getParametersInfo()
Describe parameters. |
String |
getTypeName(URL url)
|
boolean |
isAvailable()
Test to see if this datastore is available, if it has all the appropriate libraries to construct a datastore. |
static URL |
toDbfURL(URL url)
Figure out the URL for the "dbf" file |
static String |
toFilename(URL url)
Convert a URL to a String that is suitable for manipulation of its extension (generally the last three characters of the file). |
static String |
toFilename(URL url,
String ext)
Convert the URL to a string that includes the provided extension (this method respects the case of the original file extension. |
static URL |
toFixURL(URL url)
Figure out the URL for the "fix" file |
static URL |
toGrxURL(URL url)
Figure out the URL for the "grx" file |
static URL |
toPrjURL(URL url)
Figure out the URL for the "prj" file |
static URL |
toQixURL(URL url)
Figure out the URL for the "qix" file |
static URL |
toShpURL(URL url)
Figure out the URL for the "shp" file |
static URL |
toShxURL(URL url)
Figure out the URL for the "shx" file |
static URL |
toXmlURL(URL url)
Figure out the URL for the "prj" file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logger LOGGER
public static final Param URLP
public static final Param NAMESPACEP
public static final Param MEMORY_MAPPED
public static final Param CREATE_SPATIAL_INDEX
public static final Param DBFCHARSET
Constructor Detail |
---|
public ShapefileDataStoreFactory()
Method Detail |
---|
public boolean canProcess(Map params)
params
- A map of parameters describing the location of a datastore.
Files should be pointed to by a 'url' param.
public DataStore createDataStore(Map params) throws IOException
The specific implementation of ShapefileDataStore returned is not specified, and depends on the parameters given. For more information please review the public static Param instances available for this class.
URLP
NAMESPACEP
CREATE_SPATIAL_INDEX
MEMORY_MAPPED
DBFCHARSET
params
- A param list with information on the location of a restore.
For shapefiles this should contain a 'url' param which points
to a file which ends in shp.
IOException
- If a connection error (such as the file not existing occurs)
DataSourceException
- Thrown if the datastore which is created cannot be attached
to the restore specified in params.public DataStore createNewDataStore(Map params) throws IOException
This method has different logic than createDataStore. It is willing to be memory mapped, and generate an index for a local file that does not exist yet.
IOException
public String getDisplayName()
public String getDescription()
public boolean isAvailable()
public Param[] getParametersInfo()
org.geotools.data.DataStoreFactorySpi#getParametersInfo()
public String[] getFileExtensions()
org.geotools.data.dir.FileDataStoreFactorySpi#getFileExtensions()
public boolean canProcess(URL f)
org.geotools.data.dir.FileDataStoreFactorySpi#canProcess(java.net.URL)
public DataStore createDataStore(URL url) throws IOException
IOException
org.geotools.data.dir.FileDataStoreFactorySpi#createDataStore(java.net.URL)
public DataStore createDataStore(URL url, boolean memorymapped) throws IOException
IOException
org.geotools.data.dir.FileDataStoreFactorySpi#createDataStore(java.net.URL)
public String getTypeName(URL url) throws IOException
IOException
org.geotools.data.dir.FileDataStoreFactorySpi#getTypeName(java.net.URL)
public Map getImplementationHints()
When we have FeatureFactory, GeometryFactory and so on hooked up this map will return Hints we paid attention too when we were constructed.
public static String toFilename(URL url) throws MalformedURLException
url
- the url to convert to a String. Must not be null.
MalformedURLException
- if the url is invalidpublic static String toFilename(URL url, String ext) throws MalformedURLException
url
- ext
-
MalformedURLException
public static URL toFixURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toQixURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toGrxURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toXmlURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toPrjURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toShxURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toDbfURL(URL url) throws MalformedURLException
MalformedURLException
public static URL toShpURL(URL url) throws MalformedURLException
MalformedURLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |