Open source · GeoSquare V2

Grid cells that are close to square on the ground.

GeoSquare V2 turns points, polygons and tables into metre-sized cells with stable IDs. Each country uses its own projection.

Cells are 50 m per side at level 12 and 5 m at level 14. Source: cellSideM in the engine build, and the geosquare-v2 README.

Live engine · level 12 · Indonesia

Loading the map and the engine.

GID at level 12············
Cell side at level 12
50 m
Cell side at level 14
5 m
ASEAN domains, 6 released
11
Open source code
Apache-2.0
// 01Start

Try it in 10 seconds

Install the Python package from PyPI and run this. The output below is from geosquare-engine 0.3.0 on Python 3.14.

  1. 01

    Install

    Install geosquare-engine from PyPI. It needs Python 3.11 to 3.14.

  2. 02

    Run

    Encode a level 12 cell, then ask for its side length and its neighbours.

  3. 03

    Read the output

    A level 12 cell is 50 m wide and has 8 neighbours.

  4. To convert real longitude and latitude, use geosquare-v2 with a git clone. See Install.
terminal
pip install geosquare-engine
quickstart.py
import geosquare_engine as gs

gid = gs.encode(12, 475168, 491792)
print("GID:", gid)
print("Cell side (m):", gs.cell_side_m(12))
print("Neighbours:", len(gs.k_ring(gid, 1)))
output
GID: H2X545M5X4E2
Cell side (m): 50.0
Neighbours: 8
geosquare-engine 0.3.0 · Python 3.14
// 02Fit

Who it is for, and what is not ready

Use it if

  • You plan or report on ASEAN statistics and need the same cells across years. Nine of 11 domains keep their GIDs.
  • You do research that needs metric cells in a national projection.
  • You build an app that needs small, stable cells for points, polygons or tables, in Python or the browser.
  • You want to choose the aggregation rule for each column.

Not ready yet

  • npm: the browser package is not published. Build it from the engine repo.
  • gsq CLI: not on PyPI yet. Install it from the engine repo.
  • DuckDB: the extension is built from source. Linux users can also use a published build.
  • Candidate profiles: KH, MM, TH, TL and VN are provisional. VN and LA have some GID changes against profile 1.0.0.
  • Python: the engine supports Python 3.11 to 3.14.
// 03Why use it

Seven reasons to pick GeoSquare V2

Each point below links to the document that backs it.

01

Square on the ground

Each country has its own metric projection, so cells are close to square in metres on the ground. Web Mercator tiles change ground size with latitude.

Source: comparison.md, section 9
02

Stable IDs, with two exceptions (VN, LA)

Data written with profile 1.0.0 still loads. Nine of 11 domains keep the same GIDs. For some VN and LA points the GID changed, and the reader warns you. Do not join old and new VN or LA data.

Source: profile-compatibility.md
03

You pick the rule

Each column gets its own rule: sum, weighted mean, median, max or min. Empty values are skipped, not counted as 0.

Source: data-and-aggregation.md
05

One rule set, three places

geosquare-engine runs the same Rust core in Python, the browser (WebAssembly) and DuckDB. The grid rules are not copied into each language. geosquare-v2 holds the spec and profiles.

Source: bindings/wasm/README.md
06

Signed country profiles

Each profile names its datum and projection. The loader checks a signature before it computes any cell.

Source: country-profiles.md
07

Open code, clear data terms

The code is Apache-2.0. Boundary files keep their own licences, such as ODbL 1.0 or CC BY 4.0. Read them before you reuse data.

Source: data-licenses.md
ASEAN

Scope today

Released domains: BN, ID, LA, MY, PH and SG. Candidate domains: KH, MM, TH, TL and VN. Candidate domains need an explicit opt-in flag and may change.

// 04Compared with other systems

Where GeoSquare fits, and where it does not

GeoSquare is a national grid for ASEAN countries. Other systems are built for global work. Each has trade-offs.

Sources: comparison.md sections 4 to 7 and 9. The numeric ASEAN benchmark is an internal file and is not public.
TopicGeoSquare V2H3S2GeohashAdmin boundaries
Cell shapeSquare in metres, per country projectionHexagons, with 12 pentagon base cellsQuadrilaterals on a global gridRectangles, about 2:1 sides at the tested precisionIrregular polygons
Coverage11 ASEAN domains. 6 released, 5 candidate.GlobalGlobalGlobalOne country at a time
Strong atMetric analysis per country, stable IDs, explicit rulesNeighbourhood analysis and a large tool ecosystemGlobal indexing with a quadrilateral layoutSimple prefix lookupOfficial reports and statistics
Main limitNot global. Candidate profiles are provisional.Not square. No country-specific metric CRS.Cell area and side vary more.Rectangles, not metre squares.Shape and size follow the boundary, not a fixed grid.

Use GeoSquare as the national identity. Add H3, S2 or geohash indexes only when a query needs them. See recommended use.

// 05The three packages

How they fit together

The spec comes first. The engine computes. The platform serves data over an API.

The platform docs are in Bahasa Indonesia. The platform is a server app, not a library.

// 06Install

Install it today

Python packages are on PyPI. Other parts build from the repos. Status is checked on the day this page was built.

Python: geosquare-v2 1.3.0

terminal
python -m pip install "geosquare-v2[registry]"

The quick start needs a git clone of the repo for the trust file and registry files.

Python: geosquare-engine 0.3.0

terminal
pip install geosquare-engine

Needs Python 3.11 to 3.14.

  • Not on npmThe browser package is not published. Build it from bindings/wasm with npm run build.
  • Not on PyPIThe DuckDB extension. Build it from bindings/duckdb with build.sh.
  • Not on PyPIThe gsq command-line tool. Install it from the engine repo.
  • Server appThe platform runs with uv sync and uv run uvicorn. See its README.
open source

One grid for every dataset.
Free to build on.

Read the docs, try the engine in your browser, or open an issue on the repo that holds the problem.