Skip to content

neiybor/h3-udf-for-athena

 
 

Repository files navigation

H3 User Defined Function(s) (UDF) for Athena

Forked from aws-samples/h3-udf-for-athena for use at Neighbor. Differences include the following changes:

  • Readded @Test annotations for JUnit tests
  • Modified functions to work with GeoJSON-style WKT text, where coordinates are in the form of longitude latitude, as opposed to latitude longitude
  • Using the NGA Simple Features Java to perform WKT parsing and Geometry manipulation

This repository contains example code to support the blog post Extend geospatial queries in Amazon Athena with UDFs and AWS Lambda. The UDF makes it straightforward for Amazon Athena to find out which Uber H3 hexagon a pair of (lat, long) coordinates are in. This can be used for subsequent analysis and visualisation.

We include code for the AWS Lambda function that powers the new Athena UDF. Also included is an example Jupyter Notebook which may be used in an Amazon SageMaker Notbook Instance to render a choropleth map.

Map

How to use

  • Package the UDF by going to the udf directory and running mvn clean package
  • Run tests by going to the udf directory and running mvn clean test
  • Run cdk deploy in the infrastructure directory of the repository

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

Perform H3 functions within Athena queries

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 95.0%
  • Java 4.7%
  • Python 0.3%