How Hexmap Works

Key concepts

Map structure

The map cell structure are based on the H3 spatial indexing standard, from Nick Rabinowitz via Uber. After extensive experimentation with geohash and arbitrary coordinate bucketing with sample data from various latitudes, it became clear a DGGS was needed.

Inspired by Niantic's Pokémon Go, I started aggregating with Google's S2, which worked well. Then Uber dropped H3 on the world, and I simply found it more beautiful. I migrated my Node.js experiments to it and never looked back. I started Hexmap, as an exercise to learn Rust, before A5 was launched, but maybe the world needs a Pentamap, too? Anyway, hexagons are the bestagons.

We use resolution 10 of the H3 grid, so there are 33,897,029,882 cells. (12 of these are pentagons.) Lower resolutions are not calculated from base data, partly to avoid accidental precision., but higher resolutions are used for visualization when "zoomed out" to large areas.

The public addresses for cells use the encoding regime from Placekey.

Visit levels

Behind the scenes, visits are designated with one of 5 levels of increasing weight of evidence, listed below. Visits at the trace and path levels represent movement and are drawn with thinner lines.

trace ambient tracking phone logging
path explicitly recorded movement outdoor workout logs
dwell detected linguring in a location a six-minute pause during a run
breadcrumb location metadata from an explicit action photos
checkin explicitly recorded presence Swarm checkins

What day is it?

It can be surprisingly difficult to determine what day a visit occured on. Many data sources give only a UTC ("universal") time, which is fine if you're in Greenland or Ghana, but usually it's a bit more complicated. Some sources will offer a timezone, but even that doesn't alway help. If you ride your bike across a timezone border, for example, Strava will only tell us the timezone you began in.

So we record everything in UTC, and use the location and time to determine what the local time was for each visit, before aggragating to days. Thanks to OpenStreetMap, the coordination of Evan Siroky (motivated by transit mapping), and algorithmic optimization of "ringsaturn" (motivated by meteorology) we associate each cell with a canonical IANA time zone identifier. Borders can be weird, so instead of relying only on center coordinates, we calculate the primary time zone using 7 points in each cell.

This could be still seem like the wrong choice! Between the imprecision of the maps and projection of cells onto the Earth spheroid, there may be some cells that are designated in a timezone that actually comprises a minority of the possible cell area. If you have visits near midnight that appear a day too early or late on your map, let us know and we can manually designate the cell into a more sensible timezone.