public class ShapeFileInputFormat
extends <any>
org.apache.hadoop.mapred.FileInputFormat
for ESRI Shapefiles. The input has to be the main file (.shp). The directories in HDFS where the index files and DBF files are located can be specified. As well a directory to find .cpg files can be specified to define the encoding. By default the same directory as the main shapefile will be used. DBF and CPG files are optional. Keys are the position in the main file, and values are Maps with the attributes of the Shapefile record including the ShapeFileInputFormat.GEOMETRY_ATTRIBUTE.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GEOMETRY_ATTRIBUTE
The name of the geometry attribute.
|
Constructor and Description |
---|
ShapeFileInputFormat() |
Modifier and Type | Method and Description |
---|---|
Configuration |
getConf() |
static java.lang.String |
getCPGFilesPath(JobConf conf)
Returns the optional CPG files path.
|
static java.lang.String |
getDBFFilesPath(JobConf conf)
Returns the optional DBF files path.
|
static java.lang.String |
getIndexFilesPath(JobConf conf)
Returns the index files path.
|
<any> |
getRecordReader(InputSplit split, JobConf conf, Reporter reporter) |
void |
setConf(Configuration conf) |
static void |
setCPGFilesPath(JobConf conf, java.lang.String cpgFilePath)
Sets the CPG files path.
|
static void |
setDBFFilesPath(JobConf conf, java.lang.String dbfFilePath)
Sets the DBF files path.
|
static void |
setIndexFilesPath(JobConf conf, java.lang.String indexFilePath)
Sets the index files path.
|
public static java.lang.String GEOMETRY_ATTRIBUTE
public Configuration getConf()
public static java.lang.String getCPGFilesPath(JobConf conf)
conf
- the job configurationpublic static java.lang.String getDBFFilesPath(JobConf conf)
conf
- the job configurationpublic static java.lang.String getIndexFilesPath(JobConf conf)
conf
- the job configurationpublic <any> getRecordReader(InputSplit split, JobConf conf, Reporter reporter) throws java.io.IOException
java.io.IOException
public void setConf(Configuration conf)
public static void setCPGFilesPath(JobConf conf, java.lang.String cpgFilePath)
conf
- the job configurationcpgFilePath
- the CPG files pathpublic static void setDBFFilesPath(JobConf conf, java.lang.String dbfFilePath)
conf
- the job configurationdbfFilePath
- the DBF files pathpublic static void setIndexFilesPath(JobConf conf, java.lang.String indexFilePath)
conf
- the job configurationindexFilePath
- the index files pathCopyright © 2017 Oracle and/or its affiliates. All Rights Reserved.