org.geotools.data.mif
Class MIFDataStore

java.lang.Object
  extended byorg.geotools.data.AbstractDataStore
      extended byorg.geotools.data.mif.MIFDataStore
All Implemented Interfaces:
DataStore

public class MIFDataStore
extends AbstractDataStore

MIFDataStore gives read and write access to MapInfo MIF files. It can be instantiated either on a single .mif file, or on a directory (thus exposing all the mif files within).

MIFDataStore is a replacement for the MapInfoDataStore, which was based on the legacy MapInfoDataSource.

Version:
$Id: MIFDataStore.java 17700 2006-01-22 23:30:39Z desruisseaux $
Author:
Luca S. Percich, AMA-MI

Field Summary
static java.lang.String HCLAUSE_CHARSET
           
static java.lang.String HCLAUSE_COORDSYS
           
static java.lang.String HCLAUSE_DELIMITER
           
static java.lang.String HCLAUSE_INDEX
           
static java.lang.String HCLAUSE_TRANSFORM
           
static java.lang.String HCLAUSE_UNIQUE
           
static java.lang.String HCLAUSE_VERSION
           
static java.lang.String PARAM_FIELDCASE
           
static java.lang.String PARAM_GEOMFACTORY
           
static java.lang.String PARAM_GEOMNAME
           
static java.lang.String PARAM_GEOMTYPE
           
static java.lang.String PARAM_SRID
           
 
Fields inherited from class org.geotools.data.AbstractDataStore
isWriteable, listenerManager, LOGGER
 
Constructor Summary
MIFDataStore(java.lang.String path, java.util.HashMap params)
           Builds a new MIFDataStore given a mif file or directory path.
 
Method Summary
 void createSchema(FeatureType featureType)
           Given a FeatureType, creates the corresponding MIFFile object in the current directory .
protected  FeatureReader getFeatureReader(java.lang.String typeName)
          Gets a FeatureReader from a MIFFile object
protected  FeatureWriter getFeatureWriter(java.lang.String typeName)
          Gets a FeatureWriter from a MIFFile object
 FeatureType getSchema(java.lang.String typeName)
           Returns the schema given a type name
 java.lang.String[] getTypeNames()
           Returns the list of type names (mif files)
 
Methods inherited from class org.geotools.data.AbstractDataStore
createFeatureWriter, createLockingManager, createMetadata, getBounds, getCount, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getUnsupportedFilter, getView, updateSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HCLAUSE_VERSION

public static final java.lang.String HCLAUSE_VERSION
See Also:
Constant Field Values

HCLAUSE_CHARSET

public static final java.lang.String HCLAUSE_CHARSET
See Also:
Constant Field Values

HCLAUSE_DELIMITER

public static final java.lang.String HCLAUSE_DELIMITER
See Also:
Constant Field Values

HCLAUSE_UNIQUE

public static final java.lang.String HCLAUSE_UNIQUE
See Also:
Constant Field Values

HCLAUSE_INDEX

public static final java.lang.String HCLAUSE_INDEX
See Also:
Constant Field Values

HCLAUSE_COORDSYS

public static final java.lang.String HCLAUSE_COORDSYS
See Also:
Constant Field Values

HCLAUSE_TRANSFORM

public static final java.lang.String HCLAUSE_TRANSFORM
See Also:
Constant Field Values

PARAM_FIELDCASE

public static final java.lang.String PARAM_FIELDCASE
See Also:
Constant Field Values

PARAM_GEOMFACTORY

public static final java.lang.String PARAM_GEOMFACTORY
See Also:
Constant Field Values

PARAM_GEOMNAME

public static final java.lang.String PARAM_GEOMNAME
See Also:
Constant Field Values

PARAM_GEOMTYPE

public static final java.lang.String PARAM_GEOMTYPE
See Also:
Constant Field Values

PARAM_SRID

public static final java.lang.String PARAM_SRID
See Also:
Constant Field Values
Constructor Detail

MIFDataStore

public MIFDataStore(java.lang.String path,
                    java.util.HashMap params)
             throws java.io.IOException

Builds a new MIFDataStore given a mif file or directory path.

Each feature type is represented by a MIFFile object

Parameters:
path - location (directory) of the mif files to read, or full path of a single mif file. If a directory is given, the headers of all the mif files in it are read.
params - The MIFFile parameters map, see MIFFile for a full description.
Throws:
java.io.IOException - Path does not exists, or error accessing files
See Also:
MIFFile.MIFFile(String, Map)
Method Detail

createSchema

public void createSchema(FeatureType featureType)
                  throws java.io.IOException

Given a FeatureType, creates the corresponding MIFFile object in the current directory

.

Specified by:
createSchema in interface DataStore
Overrides:
createSchema in class AbstractDataStore
Parameters:
featureType - The FeatureType
Throws:
java.io.IOException - if init path is not a directory or a MIFFile object cannot be created

getTypeNames

public java.lang.String[] getTypeNames()
                                throws java.io.IOException

Returns the list of type names (mif files)

Specified by:
getTypeNames in interface DataStore
Specified by:
getTypeNames in class AbstractDataStore
Returns:
The list of type names
Throws:
java.io.IOException - Couldn't scan path for files

getSchema

public FeatureType getSchema(java.lang.String typeName)
                      throws java.io.IOException

Returns the schema given a type name

Specified by:
getSchema in interface DataStore
Specified by:
getSchema in class AbstractDataStore
Parameters:
typeName -
Returns:
Throws:
java.io.IOException

getFeatureReader

protected FeatureReader getFeatureReader(java.lang.String typeName)
                                  throws java.io.IOException
Gets a FeatureReader from a MIFFile object

Specified by:
getFeatureReader in class AbstractDataStore
Parameters:
typeName - name of the FeatureType
Returns:
The FeatureReader
Throws:
java.io.IOException

getFeatureWriter

protected FeatureWriter getFeatureWriter(java.lang.String typeName)
                                  throws java.io.IOException
Gets a FeatureWriter from a MIFFile object

Overrides:
getFeatureWriter in class AbstractDataStore
Parameters:
typeName -
Returns:
Throws:
java.io.IOException


Copyright © GeoTools. All Rights Reserved.