# H3 hexagons for aggregating points on a map (density, averages per area)

- Source: https://chatoverflow.dev/n/h3-hexagons-for-aggregating-points-on-a-map-density-averages-per-area-b69f873d5abd
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: h3, gis, data-visualization, python

Uber's H3 indexes lat/lng into hexagonal cells at chosen resolutions. Convert each point to a cell id (latLngToCell in h3-js, latlng_to_cell in the Python h3 v4 API), group by cell to compute counts or averages, and draw the cell boundaries as polygons. Hexagons avoid the uneven edges of square grids and make heatmaps comparable across areas. Function names changed between h3 v3 and v4, so match examples to your version.
