public class BC_MIFDataStore
extends org.geotools.data.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.
Modifier and Type | Class and Description |
---|---|
private class |
BC_MIFDataStore.MIFFileHolder |
Modifier and Type | Field and Description |
---|---|
private File |
filePath |
static String |
HCLAUSE_CHARSET |
static String |
HCLAUSE_COORDSYS |
static String |
HCLAUSE_DELIMITER |
static String |
HCLAUSE_INDEX |
static String |
HCLAUSE_TRANSFORM |
static String |
HCLAUSE_UNIQUE |
static String |
HCLAUSE_VERSION |
private HashMap |
mifFileHolders |
static String |
PARAM_FIELDCASE |
static String |
PARAM_GEOMFACTORY |
static String |
PARAM_GEOMNAME |
static String |
PARAM_GEOMTYPE |
static String |
PARAM_SRID |
private HashMap |
params |
Constructor and Description |
---|
BC_MIFDataStore(String path,
HashMap params)
Builds a new MIFDataStore given a mif file or directory path.
|
Modifier and Type | Method and Description |
---|---|
void |
createSchema(org.geotools.feature.FeatureType featureType)
Given a FeatureType, creates the corresponding MIFFile object in the
current directory
.
|
protected org.geotools.data.FeatureReader |
getFeatureReader(String typeName)
Gets a FeatureReader from a MIFFile object
|
protected org.geotools.data.FeatureWriter |
getFeatureWriter(String typeName)
Gets a FeatureWriter from a MIFFile object
|
private BC_MIFFile |
getMIFFile(String typeName)
Returns a MIFFile object given its type name.
|
org.geotools.feature.FeatureType |
getSchema(String typeName)
Returns the schema given a type name
|
String[] |
getTypeNames()
Returns the list of type names (mif files)
|
private void |
registerMIF(String path)
Loads a MIF file header and create the corresponding schema.
|
private int |
scanFiles(File filePath)
Looks for all the .mif files in the given Path
|
createFeatureWriter, createLockingManager, createMetadata, getBounds, getCount, getFeatureReader, getFeatureReader, getFeatureSource, getFeatureWriter, getFeatureWriter, getFeatureWriterAppend, getLockingManager, getUnsupportedFilter, getView, updateSchema
public static final String HCLAUSE_VERSION
public static final String HCLAUSE_CHARSET
public static final String HCLAUSE_DELIMITER
public static final String HCLAUSE_UNIQUE
public static final String HCLAUSE_INDEX
public static final String HCLAUSE_COORDSYS
public static final String HCLAUSE_TRANSFORM
public static final String PARAM_FIELDCASE
public static final String PARAM_GEOMFACTORY
public static final String PARAM_GEOMNAME
public static final String PARAM_GEOMTYPE
public static final String PARAM_SRID
private final File filePath
private HashMap params
private final HashMap mifFileHolders
public BC_MIFDataStore(String path, HashMap params) throws IOException
Builds a new MIFDataStore given a mif file or directory path.
Each feature type is represented by a MIFFile object
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.IOException
- Path does not exists, or error accessing filesprivate int scanFiles(File filePath) throws IOException
Looks for all the .mif files in the given Path
filePath
- IOException
public void createSchema(org.geotools.feature.FeatureType featureType) throws IOException
Given a FeatureType, creates the corresponding MIFFile object in the current directory
.createSchema
in interface org.geotools.data.DataStore
createSchema
in class org.geotools.data.AbstractDataStore
featureType
- The FeatureTypeIOException
- if init path is not a directory or a MIFFile object cannot be
createdpublic String[] getTypeNames() throws IOException
Returns the list of type names (mif files)
getTypeNames
in interface org.geotools.data.DataStore
getTypeNames
in class org.geotools.data.AbstractDataStore
IOException
- Couldn't scan path for filespublic org.geotools.feature.FeatureType getSchema(String typeName) throws IOException
Returns the schema given a type name
getSchema
in interface org.geotools.data.DataStore
getSchema
in class org.geotools.data.AbstractDataStore
typeName
- der Name des TypsIOException
- IO-Fehler beim ermitteln des Featuresprotected org.geotools.data.FeatureReader getFeatureReader(String typeName) throws IOException
getFeatureReader
in class org.geotools.data.AbstractDataStore
typeName
- name of the FeatureTypeIOException
protected org.geotools.data.FeatureWriter getFeatureWriter(String typeName) throws IOException
getFeatureWriter
in class org.geotools.data.AbstractDataStore
typeName
- IOException
private void registerMIF(String path) throws IOException
Loads a MIF file header and create the corresponding schema.
path
- path of single .MIF file.IOException
private BC_MIFFile getMIFFile(String typeName)
Returns a MIFFile object given its type name.
typeName
- Copyright © 2017 BitCtrl Systems GmbH. All rights reserved.