public class GeoJsonRecordInfoProvider extends java.lang.Object implements RecordInfoProvider<LongWritable,Text>, 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(Configuration conf)
Returns true if geojson's properties will be added as extra fields in the index, false otherwise
|
Configuration |
getConf() |
static int |
getDimensions(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.
|
JGeometry |
getGeometry()
Gets the geometry of the current record
|
java.lang.String |
getId()
Gets the id of the current record
|
JsonNode |
getRecordNode()
Returns the
org.codehaus.jackson.JsonNode of the record. |
static int |
getSrid(Configuration conf)
Returns the SRID.
|
static void |
setAddExtraFields(Configuration conf, boolean addExtraFields)
Sets the add extra fields flag.
|
void |
setConf(Configuration conf) |
void |
setCurrentRecord(LongWritable key, Text value)
Sets the record's key and value.
|
static void |
setDimensions(Configuration conf, int dimensions)
Sets the geometries dimensions.
|
static void |
setSrid(Configuration conf, int srid)
Sets the SRID.
|
public GeoJsonRecordInfoProvider()
public static boolean addExtraFields(Configuration conf)
conf
- the job configurationpublic Configuration getConf()
public static int getDimensions(Configuration conf)
conf
- the job configurationpublic boolean getExtraFields(java.util.Map<java.lang.String,java.lang.String> extraFields)
RecordInfoProvider
getExtraFields
in interface RecordInfoProvider<LongWritable,Text>
extraFields
- An empty map where the extra fields can be addedpublic JGeometry getGeometry()
RecordInfoProvider
getGeometry
in interface RecordInfoProvider<LongWritable,Text>
public java.lang.String getId()
RecordInfoProvider
getId
in interface RecordInfoProvider<LongWritable,Text>
public JsonNode getRecordNode()
org.codehaus.jackson.JsonNode
of the record.public static int getSrid(Configuration conf)
conf
- the job configurationpublic static void setAddExtraFields(Configuration conf, boolean addExtraFields)
conf
- the job configurationaddExtraFields
- If true then geojson's properties will be added as extra fields in the indexpublic void setConf(Configuration conf)
public void setCurrentRecord(LongWritable key, Text value)
RecordInfoProvider
setCurrentRecord
in interface RecordInfoProvider<LongWritable,Text>
key
- A record's keyvalue
- A record's valuepublic static void setDimensions(Configuration conf, int dimensions)
conf
- the job configurationdimensions
- the geometries dimensionspublic static void setSrid(Configuration conf, int srid)
conf
- the job configurationsrid
- the SRIDCopyright © 2017 Oracle and/or its affiliates. All Rights Reserved.