public class GeoJsonRecordInfoProvider extends java.lang.Object implements SparkRecordInfoProvider<Text>, java.io.Serializable
SparkRecordInfoProvider
for GeoJSON text files. Can be used with GeoJsonInputFormat
to read GeoJSON files. If the record is a GeoJSON feature then an extra field named RECORD_ID containing the feature id will be added.Constructor and Description |
---|
GeoJsonRecordInfoProvider() |
GeoJsonRecordInfoProvider(java.util.List<java.lang.String> properties, int dimensions, int srid)
Create a GeoJsonRecordInfoProvider
|
Modifier and Type | Method and Description |
---|---|
boolean |
getRecordInfo(Text value, SparkRecordInfo recordInfo)
Extracts spatial and other required data from the value input parameter and sets the extracted data to the recordInfo output parameter
|
int |
getSrid()
Gets the SRID of the geometries returned by getRecordInfo
|
void |
setSrid(int srid)
Sets the SRID of the geometries returned by getRecordInfo
|
public GeoJsonRecordInfoProvider()
public GeoJsonRecordInfoProvider(java.util.List<java.lang.String> properties, int dimensions, int srid)
properties
- list of the GeoJSON properties to add to the extra fields. If null then no properties will be added.dimensions
- the geometries dimensionssrid
- the SRIDpublic boolean getRecordInfo(Text value, SparkRecordInfo recordInfo)
SparkRecordInfoProvider
getRecordInfo
in interface SparkRecordInfoProvider<Text>
value
- a record from an RDDrecordInfo
- a SparkRecordInfo
instance to be filled with data from valuepublic int getSrid()
SparkRecordInfoProvider
getSrid
in interface SparkRecordInfoProvider<Text>
public void setSrid(int srid)
SparkRecordInfoProvider
setSrid
in interface SparkRecordInfoProvider<Text>
Copyright © 2017 Oracle and/or its affiliates. All Rights Reserved.