public class ShapeFileInputFormat
extends <any>
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 |
---|---|
<any> |
createRecordReader(InputSplit split, TaskAttemptContext context) |
Configuration |
getConf() |
static java.lang.String |
getCPGFilesPath(Configuration conf)
Returns the optional CPG files path.
|
static java.lang.String |
getDBFFilesPath(Configuration conf)
Returns the optional DBF files path.
|
static java.lang.String |
getIndexFilesPath(Configuration conf)
Returns the index files path.
|
void |
setConf(Configuration conf) |
static void |
setCPGFilesPath(Configuration conf, java.lang.String cpgFilePath)
Sets the CPG files path.
|
static void |
setDBFFilesPath(Configuration conf, java.lang.String dbfFilePath)
Sets the DBF files path.
|
static void |
setIndexFilesPath(Configuration conf, java.lang.String indexFilePath)
Sets the index files path.
|
public static java.lang.String GEOMETRY_ATTRIBUTE
public <any> createRecordReader(InputSplit split, TaskAttemptContext context) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public Configuration getConf()
public static java.lang.String getCPGFilesPath(Configuration conf)
conf
- the job configurationpublic static java.lang.String getDBFFilesPath(Configuration conf)
conf
- the job configurationpublic static java.lang.String getIndexFilesPath(Configuration conf)
conf
- the job configurationpublic void setConf(Configuration conf)
public static void setCPGFilesPath(Configuration conf, java.lang.String cpgFilePath)
conf
- the job configurationcpgFilePath
- the CPG files pathpublic static void setDBFFilesPath(Configuration conf, java.lang.String dbfFilePath)
conf
- the job configurationdbfFilePath
- the DBF files pathpublic static void setIndexFilesPath(Configuration conf, java.lang.String indexFilePath)
conf
- the job configurationindexFilePath
- the index files pathCopyright © 2017 Oracle and/or its affiliates. All Rights Reserved.