public class ShapeFileRecordReader
extends <any>
org.apache.hadoop.mapreduce.RecordReader
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.Constructor and Description |
---|
ShapeFileRecordReader(java.lang.String indexFilesPath, java.lang.String dbfFilesPath, java.lang.String cpgFilesPath)
Create an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
LongWritable |
getCurrentKey() |
MapWritable |
getCurrentValue() |
long |
getPos() |
float |
getProgress() |
void |
initialize(InputSplit split, TaskAttemptContext context) |
boolean |
nextKeyValue() |
public ShapeFileRecordReader(java.lang.String indexFilesPath, java.lang.String dbfFilesPath, java.lang.String cpgFilesPath) throws java.io.IOException
indexFilesPath
- index files pathdbfFilesPath
- DBF files pathcpgFilesPath
- CPG files pathjava.io.IOException
- if an IOException is thrownpublic void close() throws java.io.IOException
java.io.IOException
public LongWritable getCurrentKey()
public MapWritable getCurrentValue()
public long getPos() throws java.io.IOException
java.io.IOException
public float getProgress() throws java.io.IOException
java.io.IOException
public void initialize(InputSplit split, TaskAttemptContext context) throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
public boolean nextKeyValue() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
java.lang.InterruptedException
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.