public class GeoJsonRecordInfoProvider extends java.lang.Object implements RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>, org.apache.hadoop.conf.Configurable, java.io.Serializable
RecordInfoProvider
for GeoJSON text files. Can be used with GeoJsonInputFormat
to create indexes. The geometries SRID and dimensions can be defined. If the objects are features and the user sets the flag addExtraFields to true then the properties will be added to the extra fields.Constructor and Description |
---|
GeoJsonRecordInfoProvider()
Creates a new instance
|
Modifier and Type | Method and Description |
---|---|
static boolean |
addExtraFields(org.apache.hadoop.conf.Configuration conf)
Returns true if geojson's properties will be added as extra fields in the index, false otherwise
|
org.apache.hadoop.conf.Configuration |
getConf() |
static int |
getDimensions(org.apache.hadoop.conf.Configuration conf)
Returns the geometries dimensions.
|
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
|
org.codehaus.jackson.JsonNode |
getRecordNode()
Returns the
JsonNode of the record. |
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.Text value)
Sets the record's key and value.
|
static void |
setDimensions(org.apache.hadoop.conf.Configuration conf, int dimensions)
Sets the geometries dimensions.
|
static void |
setSrid(org.apache.hadoop.conf.Configuration conf, int srid)
Sets the SRID.
|
public GeoJsonRecordInfoProvider()
public void setCurrentRecord(org.apache.hadoop.io.LongWritable key, org.apache.hadoop.io.Text value)
RecordInfoProvider
setCurrentRecord
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
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.Text>
public oracle.spatial.geometry.JGeometry getGeometry()
RecordInfoProvider
getGeometry
in interface RecordInfoProvider<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
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 geojson's properties will be added as extra fields in the indexpublic static int getDimensions(org.apache.hadoop.conf.Configuration conf)
conf
- the job configurationpublic static void setDimensions(org.apache.hadoop.conf.Configuration conf, int dimensions)
conf
- the job configurationdimensions
- the geometries dimensionspublic org.codehaus.jackson.JsonNode getRecordNode()
JsonNode
of the record.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.Text>
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
Copyright © 2016 Oracle and/or its affiliates. All Rights Reserved.