Working with FME and Uber’s H3 Data

Jovita C.
Jovita C.
  • Updated

FME Version

  • FME 2021.0

Introduction

Uber’s Hexagonal Hierarchical Spatial Index, H3 is an open source library that provides a world grid system in hierarchical hexagons at 16 fixed resolutions. Initially developed to help Uber analyze their supply and demand for their transportation and food delivery services, H3 is a powerful tool to turn spatial problems into easy-to-compute relational problems.  

The H3HexagonIndexer transformer allows you to replace points with their containing hexagons at a selected resolution, fill polygon areas with hexagons, determine parent/child relationships in the hierarchy and neighbouring hexagons.   

 

Why Use H3 in FME 

You might use FME to process data because you need to:

  • Quickly and efficiently solve relational problems like point in polygon overlays
  • Track moving data to see trends in migrations such as in ecological data, or markets like supply and demand
  • Anonymize or generalize data to a desired cell resolution to protect privacy

Terminology

  • Cells: hexagonal areas
  • ‘Bucketing’ events into hexagons or zones, similar to hex binning
  • Index: Unique hexagon identifiers

What to Know When Working with the H3HexagonalIndexer

  • Full Containment: If you are working with data such as parcel areas where exact containment is needed, H3 may not be the best tool for your use case.
  • Spherical Geography: H3 uses Spherical Coordinates rather than Cartesian Coordinates. This means that if you have points on the edge of a hexagon and you are viewing it in 2D Cartesian Coordinates, it may not appear to be contained even though it is in H3.
  • Latitude and Longitude (Lat/lon) Coordinate Systems Only: Keep in mind that the H3HexagonalIndexer only accepts Latitude and Longitude coordinate systems input into the transformer.

 

Additional Resources

Hexagonify the World: The Theory and Applications of Uber H3: Watch our recorded Webinar with one of H3’s creators, Isaac Brodsky as a guest speaker.
Using Hexagonal Tiling and Hex Grids for Maps: Read Dale’s blog post on the applications of hexagons in tiling and mapping.
H3: Uber’s Hexagonal Hierarchical Spatial Index: See Uber’s documentation on the H3 Format.
The official H3 site: Learn more about H3’s documentation, API, and about its contributors.
H3 Indexes: Cartesian vs Spherical: Check out this external blog post that illustrates the differences between Cartesian and Spherical coordinates and how it relates to point containment.


Troubleshooting

Some of my hexagons are pentagons, or have more than six vertices…

These are called ‘Distortion Vertices’, and are an expected part of the way H3 works. There’s not too much to worry about here though, as generally the pentagons and distortion vertices occur over the water and in less populated areas of the world. As Dale says in the webinar, just don’t hard code for 6 vertices!


My child hexagons don’t fit perfectly within the parent hexagon or when I’m filling an area, I seem to be getting slivers…?

Child hexagons may not be strictly inside their parent hexagon, meaning that a point on the edge can be outside the parent hexagon. If you need to check your point against multiple levels of the hierarchy, you can’t just ask for that point location in all the different levels, you have to get the point’s cell at the smallest resolution and then get its parent, and its parent and so on, in order to get the correct compact with proper containment.


My hexagons look like they are stretched. Is this a projection issue?

Check that your input data that is input into the H3HexagonalIndexer has a Latitude and Longitude coordinate system.

 

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.