Skip to main content

IGEO7 vs S2

Google's S2 library uses a fundamentally different approach to global gridding: it starts from a cube (not an icosahedron) and produces a hierarchy of quadrilateral cells. This leads to a different set of trade-offs compared to IGEO7.

Overview

PropertyIGEO7S2
Base polyhedronIcosahedronCube
Cell shapeHexagons + 12 pentagonsQuadrilaterals (near-squares)
ProjectionISEA (equal area)Tangent/secant sphere–cube
Area variation0%up to ~30%
Resolution levels0–200–30
Finest resolution~2.9 cm (res 20)~1 cm (level 30)
Index size64-bit uint64-bit uint
HierarchyAperture 7Quadtree (aperture 4)
Pentagons12 per resolutionNone (8 cube corners)
Core libraryDGGRID / DGGALs2geometry (C++)
Python bindingdggrid4py, pydggals2sphere, pys2

Cell Shape: Hexagons vs Quadrilaterals

S2 cells are quadrilaterals — roughly square near the centre of each cube face, increasingly trapezoidal toward edges and corners. IGEO7 cells are hexagons (plus 12 pentagons at icosahedron vertices).

Hexagonal advantages:

  • All 6 neighbours are equidistant from the cell centre (isotropic neighbourhood)
  • No preferred axis — hexagonal grids avoid the row/column bias of square grids
  • Better approximation of a circle for distance-based analyses

Quadrilateral advantages:

  • Simple 2D addressing (i, j) within each cube face
  • Natural alignment with raster data (images, DEMs)
  • Familiar mental model for GIS users

Area Distortion

S2 applies a tangential projection from sphere to cube face, with a non-linear correction function to reduce (but not eliminate) area distortion. The result is approximately ±30% area variation across cells at the same level.

IGEO7's ISEA projection guarantees 0% area variation.

For analyses sensitive to cell size (density, rates, coverage fractions), IGEO7's guarantee is stronger than S2's approximation.

Hierarchy: Quadtree vs Aperture 7

S2 uses a quadtree: each cell subdivides into 4 children. This means:

  • 4× more cells per resolution step (vs 7× for IGEO7)
  • More resolution levels needed to reach the same physical scale
  • Each S2 level covers roughly half the linear scale of the previous

IGEO7's aperture-7 steps are coarser (7× per step), so fewer levels span the same range from continental to sub-metre.

Resolution Alignment

IGEO7 resCLSApprox. S2 levelS2 avg area
5~62 km8~2,400 km²
7~8.9 km11~300 km²
9~1.3 km14~37 km²
11~181 m17~4,600 m²
14~9.8 m23~18 m²

Note: S2 has 30 levels (0–29) vs IGEO7's 21, reflecting the smaller step size (4× vs 7× per level).

Indexing

Both use 64-bit integers, but the encoding differs:

IGEO7 Z7S2 Cell ID
StructureBase cell + resolution digitsHilbert curve position
HierarchyExplicit digit structureImplicit in bit pattern
ParentTruncate last digitBit shift
String2-char base + octal digitsDecimal or token string

S2 Cell IDs encode position along a Hilbert space-filling curve mapped across the cube faces. The hierarchical parent/child relationship is encoded in the trailing bits.

When to Choose IGEO7 vs S2

Choose IGEO7 when:

  • Zero area distortion is required (density, coverage statistics)
  • Hexagonal topology is preferred (isotropic neighbourhood)
  • OGC API DGGS compliance is needed
  • Integration with DGGRID-based workflows

Choose S2 when:

  • You need natural alignment with raster/image data (quadrilateral cells)
  • You are integrating with existing S2-based infrastructure (Google Maps Platform, BigQuery GIS)
  • Very fine resolution (< 3 cm) is needed (S2 level 30 ≈ 1 cm)
  • Quadtree spatial indexing suits your data structure

Further Reading