FME Transformers: 2024.1

Categories
Calculated Values
Geometries
Related Transformers
GeometryExtractor
GeometryReplacer

# H3HexagonalIndexer

Computes and manipulates hexagonal hierarchical spatial indexes (Uber H3), and enables spatial data to be grouped into hexagonal grid cells for analysis and visualization.

### Typical Uses

• Replace the point geometry of a feature with the H3 hexagon that contains it
• Calculate the H3 Index for a given point at a supplied H3 resolution
• Return all the H3 indices that are contained by an area, so that spatial containment can be done by comparing indices
• Return all the neighbor H3 indices of a given index
• Return the parent (lower resolution) H3 index of a given index
• Return all the child (higher resolution) H3 indexes of a given index.

## How does it work?

The H3HexagonalIndexer provides easy access within an FME workflow to the key operations made available by the open source Uber H3 library. This library partitions the earth into a set of 16 different hexagonal grids, ranging in size from 122 cells covering the earth at level 0, all the way to the finest-grained cells at level 15 with edges approximately 0.5 m long.

The transformer operates on one feature at a time, doing the requested index operation, and optionally changing the geometry to the hexagon of the computed index or removing the geometry entirely. Operations which result in several indexes being returned (such as neighbor or child computation) copy the input feature for each resulting index, adding the computed index as a new attribute and optionally changing the geometry.

The most common operation is to compute an hexagonal index for an appropriate-for-use resolution and replace the geometry of the feature with this hexagon for downstream aggregation (typically by a StatisticsCalculator) for visualization.

Another common use case is to calculate the index and remove the geometry, so that downstream storage and analysis operate only on the index and thus can be done using relational rather than spatial computation.

This transformer is implemented such that there is always one feature per H3 Index. Only one index will be read per input feature and one output feature will be generated for every H3 Index that is output. The output features will be clones of the input feature except for the new data and any changes to geometry specified by the Geometry Handling parameter.

Note that features must have geographic coordinates (latitude/longitude).

H3 was designed for managing and understanding high volumes of GPS reported locations, and as such, exact accuracy in some of the operations is not possible. For example, child hexagons and a finer resolution are not all strictly contained in their parent. Further, the parent of a child hexagon containing a point may not be the same hexagon as if the index were computed at the parent level for the original point. If exact containment is needed, then spatial operations present in the PointOnAreaOverlayer or SpatialFilter/SpatialRelator maybe more appropriate.

## Usage Notes

• Features must be in a geographic coordinate system (latitude/longitude). The Reprojector or its related transformers may be used to reproject from other coordinate systems.
• H3 Indexes output by the transformer are integers. To obtain H3 Indexes as hexadecimal strings (H3’s canonical representation), use a BaseConverter with Original Base set to 10 and Convert to Base set to 16.

• Similarly, input H3 Indexes should be integers or decimal strings. To convert hexadecimal strings into decimal strings use a BaseConverter with Original Base set to 16 and Convert to Base set to 10.

## Editing Transformer Parameters

Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.

## Reference

 Processing Behavior Feature Holding No Dependencies Aliases H3Indexer History

## FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for all results about the H3HexagonalIndexer on the FME Community.

Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.