Engine and concurrency¶
gometry runs geometry operations in Rust and uses Python for ecosystem integration. This keeps array operations out of Python loops and lets the package bundle its geometry and CRS engines together.
Native and Python responsibilities¶
| Layer | Responsibility |
|---|---|
| Native geometry core | Construction, predicates, overlay, measurement, CRS handling, geodesy, grids, indexing, validation, repair, and geometry I/O. |
| Python interface | Python protocols, type annotations, and optional adapters. |
| CRS authority | The bundled PROJ backend supplies CRS definitions, datum pipelines, grid-aware transforms, and standards parsing. Gometry owns frame checks, X/Y ordering, Z/M policy, and Python errors around that boundary. |
| Interchange adapters | Arrow/GeoArrow, WKB, dataframe, GeoParquet, and map adapters translate at explicit boundaries and state when they copy or lose metadata. |
Bundled CRS transformations¶
Gometry bundles PROJ and its CRS database; no system installation is needed. The Python API uses X/Y even when an authority definition declares a different native axis order. See CRS, units & measurement for frame matching, units, and transformation resources.
Geographic topology¶
Geographic topology treats seam-equivalent longitudes and longitude aliases at the poles as the same locations. Geometry edges remain straight in their source coordinate chart; geodesic measurement is a separate operation. Results use binary64 coordinates, and an operation reports an error rather than silently changing topology when rounded coordinates cannot preserve the required relationships. Z and M behavior remains specific to each operation; see geometry and coordinates.
Data interchange¶
Exchange geometry with dataframes and databases through Arrow, GeoArrow, or WKB. gometry does not provide a storage or SQL engine.
The Arrow C Data Interface is an ABI boundary. Providers must conform to the interface; gometry copies and validates their data before decoding it. See Arrow & storage and Security & untrusted input for the trust and resource boundaries.
Runtime concurrency¶
On standard CPython, native work can release the interpreter lock after Python inputs are captured, including bulk array work and scalar topology predicate and nearest-point evaluation. Lock release is an implementation detail, not a per-API parallelism guarantee. On a free-threaded build, the same public API is used without separate thread-specific entry points.
Immutable geometries, arrays, cells, CRS values, and grouped containers can be
shared after construction, including the indexes a geometry builds for itself
when it is probed repeatedly. SpatialIndex supports concurrent
query-only use; callers should serialize writes and queries that must observe a
particular write boundary.
Use processes when hard isolation, independent resource budgets, or standard
CPython process-level parallelism is the requirement. pickle carries the durable
geometry values and containers, while derived index or prepared state is
reconstructed when loaded.
See also¶
- API conventions — naming and result conventions.
- Compatibility — runtime and optional-integration matrix.
- Arrow & storage — columnar interchange behavior.
- Security & untrusted input — ingress trust boundaries and limits.