public class ShapeFileRecordInfoProvider extends java.lang.Object implements RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.MapWritable>, org.apache.hadoop.conf.Configurable
RecordInfoProvider
for ESRI Shapefiles. Can be used with ShapeFileInputFormat
to create indexes. The value is a Map containing all the Shapefile attributes including ShapeFileInputFormat.GEOMETRY_ATTRIBUTE. The geometries SRID can be defined. If the user sets the flag addExtraFields to true then the Shapefile attributes will be added to the extra fields.Constructor and Description |
---|
ShapeFileRecordInfoProvider()
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
static boolean |
addExtraFields(org.apache.hadoop.conf.Configuration conf)
Returns true if shapefile's attributes will be added as extra fields in the index, false otherwise
|
org.apache.hadoop.conf.Configuration |
getConf() |
boolean |
getExtraFields(java.util.Map<java.lang.String,java.lang.String> extraFields)
If the current record contains other fields different to id and geometry that are desired to be stored for fast access, they should be returned here by adding them to the passed map.
|
oracle.spatial.geometry.JGeometry |
getGeometry()
Gets the geometry of the current record
|
java.lang.String |
getId()
Gets the id of the current record
|
java.util.Map |
getRecordValue()
Returns the map record value.
|
static int |
getSrid(org.apache.hadoop.conf.Configuration conf)
Returns the SRID.
|
static void |
setAddExtraFields(org.apache.hadoop.conf.Configuration conf, boolean addExtraFields)
Sets the add extra fields flag.
|
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setCurrentRecord(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.MapWritable value)
Sets the record's key and value.
|
static void |
setSrid(org.apache.hadoop.conf.Configuration conf, int srid)
Sets the SRID.
|
public ShapeFileRecordInfoProvider()
public void setCurrentRecord(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.MapWritable value)
RecordInfoProvider
setCurrentRecord
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.MapWritable>
key
- A record's keyvalue
- A record's valuepublic java.lang.String getId()
RecordInfoProvider
getId
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.MapWritable>
public oracle.spatial.geometry.JGeometry getGeometry()
RecordInfoProvider
getGeometry
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.MapWritable>
public static int getSrid(org.apache.hadoop.conf.Configuration conf)
conf
- the job configurationpublic static void setSrid(org.apache.hadoop.conf.Configuration conf, int srid)
conf
- the job configurationsrid
- the SRIDpublic static boolean addExtraFields(org.apache.hadoop.conf.Configuration conf)
conf
- the job configurationpublic static void setAddExtraFields(org.apache.hadoop.conf.Configuration conf, boolean addExtraFields)
conf
- the job configurationaddExtraFields
- If true then shapefile's attributes will be added as extra fields in the indexpublic java.util.Map getRecordValue()
public boolean getExtraFields(java.util.Map<java.lang.String,java.lang.String> extraFields)
RecordInfoProvider
getExtraFields
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.MapWritable>
extraFields
- An empty map where the extra fields can be addedpublic org.apache.hadoop.conf.Configuration getConf()
getConf
in interface org.apache.hadoop.conf.Configurable
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable