1. Install the engine
The engine is the fastest way to start. It has no extra setup.
terminal
pip install geosquare-engine2. Convert a coordinate to a GID
This example comes from the engine quick start. It was checked against the WebAssembly build of the same core.
quickstart.py
import geosquare_engine as gs
gid = gs.encode(12, 475168, 491792)
print(gid) # H2X545M5X4E2
print(gs.decode(gid)) # (12, 475168, 491792)
print(gs.cell_side_m(12)) # 50.0Level 12 cells are 50 m wide. Read concepts to learn what the level and GID mean.
3. Work with country data
To turn a longitude and latitude into a cell in a named country, use the geosquare-v2 package. It needs a git clone for the trust file and registry. Install it with python -m pip install "geosquare-v2[registry]".
See the Python page for the code. The full steps are in the quick start.
4. Try it in the browser
The playground runs the same Rust core in your browser. No install is needed.