Source: https://gometry.monicz.dev/about/internals/

# 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](https://gometry.monicz.dev/guide/crs/) 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](https://gometry.monicz.dev/guide/geometry/#zm-under-operations).

## 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](https://gometry.monicz.dev/ecosystem/arrow/) and [Security & untrusted input](https://gometry.monicz.dev/about/security/)
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](https://gometry.monicz.dev/about/compatibility/#runtime-and-platform-matrix),
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`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex "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`](https://docs.python.org/3/library/pickle.html) carries the durable
geometry values and containers, while derived index or prepared state is
reconstructed when loaded.

## See also

- [API conventions](https://gometry.monicz.dev/about/design/) — naming and result conventions.
- [Compatibility](https://gometry.monicz.dev/about/compatibility/) — runtime and optional-integration matrix.
- [Arrow & storage](https://gometry.monicz.dev/ecosystem/arrow/) — columnar interchange behavior.
- [Security & untrusted input](https://gometry.monicz.dev/about/security/) — ingress trust boundaries and limits.
