Giter Site home page Giter Site logo

h3-spark's Introduction

H3 / Apache Spark SQL

Brings H3 - Hexagonal hierarchical geospatial indexing system support to Apache Spark SQL

Scala CI License Maven Central

Installation

Fetch the JAR file from Maven.

libraryDependencies += "io.github.nuzigor" %% "h3-spark" % "0.9.1"

h3-spark supports only Spark 3.2.1+.

Function registration

Register h3 functions with these commands:

com.nuzigor.spark.sql.h3.registerFunctions

Spark SQL extensions registration

Config your spark applications with spark.sql.extensions option: spark.sql.extensions=com.nuzigor.spark.sql.h3.H3SqlExtensions

For example, to use in pure Spark SQL environment:

spark-sql --packages io.github.nuzigor:h3-spark_2.12:0.9.1 --conf spark.sql.extensions=com.nuzigor.spark.sql.h3.H3SqlExtensions

Supported functions

Spark function Corresponding h3 function
h3_from_latlng latLngToCell
h3_from_wkt latLngToCell
h3_array_from_wkt latLngToCell, polygonToCells, gridPathCells
h3_grid_disk gridDisk
h3_grid_ring gridRingUnsafe
h3_grid_path gridPathCells
h3_grid_distance gridDistance
h3_get_resolution getResolution
h3_is_valid isValidCell
h3_to_parent cellToParent
h3_to_children cellToChildren
h3_to_center_child cellToCenterChild
h3_compact compactCells
h3_uncompact uncompactCells
h3_are_neighbors areNeighborCells
h3_cell_area_km2 cellArea
h3_cell_area_m2 cellArea
h3_cell_area_rads2 cellArea
h3_distance_km greatCircleDistance
h3_distance_m greatCircleDistance
h3_distance_rads greatCircleDistance
h3_is_pentagon isPentagon
h3_grid_disk_distances gridDiskDistances

Unsupported functions

  • getBaseCellNumber
  • stringToH3
  • h3ToString
  • isResClassIII
  • getIcosahedronFaces
  • cellToLatLng
  • cellToBoundary
  • gridDiskUnsafe
  • gridDiskDistancesUnsafe
  • gridDiskDistancesSafe
  • gridDisksUnsafe
  • cellToLocalIj
  • localIjToCell
  • cellToChildPos
  • childPosToCell
  • cellsToLinkedMultiPolygon
  • cellsToMultiPolygon
  • cellsToDirectedEdge
  • isValidDirectedEdge
  • getDirectedEdgeOrigin
  • getDirectedEdgeDestination
  • directedEdgeToCells
  • originToDirectedEdges
  • directedEdgeToBoundary
  • cellToVertex
  • cellToVertexes
  • vertexToLatLng
  • isValidVertex
  • getHexagonAreaAvg
  • getHexagonEdgeLengthAvg
  • edgeLength
  • getNumCells
  • getRes0Cells
  • getPentagons

h3-spark's People

Contributors

nuzigor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.