object SpatialAPI
This class contains all the supported operations methods for spatial operations. Supported spatial operations:
- PointInPolygon
- SearchNearest
- JoinByDistance
- GenerateHexagon
- Alphabetic
- By Inheritance
- SpatialAPI
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def generateHexagon(sparkSession: SparkSession, minLongitude: Double, minLatitude: Double, maxLongitude: Double, maxLatitude: Double, hexLevel: Int = 1, containerLevel: Int = 1, numOfPartitions: Int = 1, maximumNumOfRowsPerPartition: Int = 1): DataFrame
A HexagonGeneration Operation: This method generates the hexagons within a bounding box defined by minimum and maximum value of longitude and latitude Hexagon output can be used for map display.
A HexagonGeneration Operation: This method generates the hexagons within a bounding box defined by minimum and maximum value of longitude and latitude Hexagon output can be used for map display.
- sparkSession
Spark session to be used
- minLongitude
Minimum longitude value of the bounding box for which hexagons needs to be generated
- minLatitude
Minimum latitude value of the bounding box for which hexagons needs to be generated
- maxLongitude
Maximum longitude value of the bounding box for which hexagons needs to be generated
- maxLatitude
Maximum latitude value of the bounding box for which hexagons needs to be generated
- hexLevel
The level to generate hexagons for. Must be between 1 and 11.
- containerLevel
A hint for providing some parallel hexagon generation. Must be less than the
hexLevelparameter.- numOfPartitions
Number of partitions
- maximumNumOfRowsPerPartition
Maximum number of rows per partition
- returns
A dataframe representing the hexagons in WKT format
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def joinByDistance(df1: DataFrame, df2: DataFrame, df1Longitude: String, df1Latitude: String, df2Longitude: String, df2Latitude: String, searchRadius: Double, distanceUnit: String, geoHashPrecision: Int = 7, options: Map[DistanceJoinOption, Any] = null): DataFrame
A JoinByDistance Operation: This method joins two dataframes taking longitude and latitude values, one set from each dataframe, representing the location of the record to be joined.
A JoinByDistance Operation: This method joins two dataframes taking longitude and latitude values, one set from each dataframe, representing the location of the record to be joined. The coordinate values must be in CoordSysConstants.longLatWGS84 coordinate system. This method also takes a
searchRadius, which is the buffer around the first point to search for the second point to be inside. The last parameter is a geohash precision that will be used within the calculation.- df1
The dataframe to join to
- df2
The dataframe to be joined
- df1Longitude
The Longitude value from the first dataframe
- df1Latitude
The Latitude value from the first dataframe
- df2Longitude
The Longitude value from the second dataframe
- df2Latitude
The Latitude value from the second dataframe
- searchRadius
The buffer length around point 1 to search for point 2
- distanceUnit
Unit of measurement for
searchRadiusparameter.- geoHashPrecision
The geohash precision value to be used for search
- options
A key/value map of DistanceJoinOption that apply to the join
- returns
A dataframe that is the result of the join
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def pointInPolygon(inputDF: DataFrame, tableFileType: String, tableFilePath: String, tableFileName: String, longitude: String, latitude: String, outputFields: Seq[String], downloadManager: DownloadManager = null, libraries: String = null, includeEmptySearchResults: Boolean = true): DataFrame
A PointInPolygon Operation: This method filters the point coordinates in input dataframe which are within a specified polygon (for example, the polygon of the continental USA) Adds output fields from polygon table to input dataset as columns.
A PointInPolygon Operation: This method filters the point coordinates in input dataframe which are within a specified polygon (for example, the polygon of the continental USA) Adds output fields from polygon table to input dataset as columns.
- inputDF
dataframe of input dataset
- tableFileType
Type of target polygon data file (either TAB/shape/geodatabase)
- tableFilePath
Path to polygon data files
- tableFileName
Name of the TAB/shape/geodatabase file
- longitude
Name of column containing longitude values in input point data
- latitude
Name of column containing latitude values in input point data
- outputFields
The requested fields to be included in the output
- downloadManager
DownloadManager instance to be used if data is present in S3 or HDFS
- libraries
libraries in case of geodatabase tableFileType
- includeEmptySearchResults
if true then an empty search will keep the original input row and the new columns will be null and if false then an empty search will result in the row not appearing in the outputted DataFrame
- returns
input DataFrame appended with output fields as columns if point coordinates lie within specified polygon
- def searchNearest(inputDF: DataFrame, tableFileType: String, tableFilePath: String, tableFileName: String, geometryStringType: String, geometryColumnName: String, outputFields: Seq[String], distanceValue: Double, distanceUnit: String, distanceColumnName: String = "distance", downloadManager: DownloadManager = null, libraries: String = null, maxCandidates: Int = 1000, includeEmptySearchResults: Boolean = true): DataFrame
A SearchNearest Operation: This method takes in a geometry string (either in GeoJSON, WKT, KML or WKB format) and searches for it in a table of geometries within a specified distance.
A SearchNearest Operation: This method takes in a geometry string (either in GeoJSON, WKT, KML or WKB format) and searches for it in a table of geometries within a specified distance. Searched geometries counts can be limited by defining
maxCandidatesparameter. By default, geometries are listed from nearest to farthest.- inputDF
dataframe of input dataset
- tableFileType
Type of target polygon data file (either TAB/shape/geodatabase)
- tableFilePath
Path to polygon data files
- tableFileName
Name of the TAB/shape/geodatabase file
- geometryStringType
Type of geometry string provided in input file. Supported values are WKT/GeoJSON/WKB/KML
- geometryColumnName
Name of column containing string representation of geometry
- outputFields
The requested fields to be included in the output
- distanceValue
The absolute value of distance from source geometry within which target geometries will be searched for.
- distanceUnit
Unit of measurement for
distanceValueparameter. This same unit will also be used when appending distance column in output dataframe.- distanceColumnName
Name of the distance column in output dataframe which indicates distance between source geometry and target geometry.
- downloadManager
DownloadManager instance to be used if data is present in S3 or HDFS
- libraries
libraries in case of geodatabase tableFileType
- maxCandidates
Limits the count of target geometries to search for
- includeEmptySearchResults
if true then an empty search will keep the original input row and the new columns will be null and if false then an empty search will result in the row not appearing in the outputted DataFrame
- returns
input DataFrame appended with output fields as columns if distance between source geometry and target geometry is within
distanceValue. Also, an additional column with namedistanceColumnNameis returned indicating the distance between source and target geometry and records are ordered by ascending value of this column.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)