Source: https://gometry.monicz.dev/migrating/cheatsheet/

# Migration cheatsheet

Look up a familiar source-library symbol and its gometry equivalent.
For a migration workflow, read [Migrating to gometry](https://gometry.monicz.dev/migrating/). For behavior,
defaults, units, errors, and output shapes, see:
[CRS, units & measurement](https://gometry.monicz.dev/guide/crs/),
[Spatial indexing & joins](https://gometry.monicz.dev/guide/indexing/), [Grids & geocodes](https://gometry.monicz.dev/guide/grids/),
[Arrays & performance](https://gometry.monicz.dev/guide/arrays/), and the linked API reference.

Conventions: `import gometry as gm`; `geom` is a gometry geometry; and
`idx = gm.SpatialIndex(...)`.

## Shapely

### Construction

| Shapely | gometry | Notes |
| --- | --- | --- |
| `Point(x, y)` | [`gm.Point(x, y, crs=...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.Point "Point") | Under a geographic CRS, `(x, y)` is `(lon, lat)`. Use `z=` / `m=` for Z/M. |
| `LineString(coords)` | [`gm.LineString(coords, z=..., m=..., crs=...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.LineString "LineString") |  |
| `Polygon(shell, holes)` | [`gm.Polygon(shell, holes, crs=...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.Polygon "Polygon") |  |
| `MultiPoint(...)` | [`gm.MultiPoint(...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.MultiPoint "MultiPoint") |  |
| `MultiLineString(...)` | [`gm.MultiLineString(...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.MultiLineString "MultiLineString") |  |
| `MultiPolygon(...)` | [`gm.MultiPolygon(...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.MultiPolygon "MultiPolygon") |  |
| `GeometryCollection(...)` | [`gm.GeometryCollection(...)`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.GeometryCollection "GeometryCollection") |  |
| `box(minx, miny, maxx, maxy)` | [`gm.box(minx, miny, maxx, maxy, crs=...)`](https://gometry.monicz.dev/api/toplevel/constructors-bulk-factories/#gometry.box "box") | In a geographic CRS, `west > east` crosses the longitude seam. |
| `shape(geojson)` | [`gm.from_geojson(obj)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_geojson "from_geojson") | GeoJSON / `__geo_interface__`. |
| `shapely.points(...)` | [`gm.points(lons, lats, z=..., m=..., crs=...)`](https://gometry.monicz.dev/api/toplevel/constructors-bulk-factories/#gometry.points "points") | Packed array. |
| mixed array | [`gm.GeometryArray([...])`](https://gometry.monicz.dev/api/geometry/geometryarray/#gometry.GeometryArray "GeometryArray") | Rust-owned container for vectorized ops. |

### Inspection

| Shapely | gometry | Notes |
| --- | --- | --- |
| `geom.geom_type` | [`geom.geometry_type`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.geometry_type "geometry_type property") |  |
| `geom.bounds` | [`geom.bounds`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.bounds "bounds property") | An array gives an `(n, 4)` matrix through [`arr.bounds`](https://gometry.monicz.dev/api/geometry/geometryarray/#gometry.GeometryArray.bounds "bounds property"). |
| `geom.has_z` | [`geom.has_z`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.has_z "has_z property") / [`geom.has_m`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.has_m "has_m property") |  |
| — | [`geom.coordinate_axes`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.coordinate_axes "coordinate_axes property") |  |
| — | [`geom.epoch`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.epoch "epoch property") |  |
| `geom.crs` (n/a in Shapely) | [`geom.crs`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.crs "crs property") |  |
| `shapely.get_coordinates(geom)` | [`geom.coords`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.coords "coords property") (`list(...)`, `.x`/`.y`, `.row_index`) | Use `np.asarray(view, dtype=np.float64)` for the flat matrix; `view.row_index` maps array coordinates to source rows. |
| `get_parts(...)` | [`geom.parts`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.parts "parts property") | A scalar gives a sequence view; an array gives row-preserving `Groups`. |
| `get_rings(...)` | [`polygon.exterior`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.Polygon.exterior "exterior property") / [`polygon.interiors`](https://gometry.monicz.dev/api/geometry/geometry-types/#gometry.Polygon.interiors "interiors property") | These expose stored shell and hole rings. For a MultiPolygon, inspect each polygon in `geom.parts`; use [`geom.boundary()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.boundary "boundary") for the topological boundary of occupied support. |
| `str(geom)` / `f"{geom:.2f}"` / `f"{geom:x}"` | same | WKT text; `.Nf`/`.Ng` round for display, `x`/`X` hex WKB. |
| `bool(geom)` | same | Falsy when empty. |
| `match geom: case Point(x, y):` | `match geom: case gm.Point(x, y):` | **gometry addition** — leaves carry `__match_args__`; Shapely 2.x has no positional match on `Point`. Arrays match `[a, *rest]`. |

### Predicates

| Shapely | gometry |
| --- | --- |
| `a.contains(b)` / `shapely.contains(a, b)` | [`gm.contains(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.contains "contains") |
| `shapely.contains_properly(a, b)` | [`gm.contains_properly(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.contains_properly "contains_properly") (also `gm.contains_properly(prep, b)` for prepared geometries, and as an index/join predicate) |
| `a.within(b)` / `shapely.within(a, b)` | [`gm.within(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.within "within") |
| `a.intersects(b)` / `shapely.intersects(a, b)` | [`gm.intersects(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.intersects "intersects") |
| `a.covers(b)` / `a.covered_by(b)` | [`gm.covers(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.covers "covers") / [`gm.covered_by(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.covered_by "covered_by") |
| `a.disjoint(b)` | [`gm.disjoint(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.disjoint "disjoint") |
| `a.touches(b)` / `a.crosses(b)` / `a.overlaps(b)` | [`gm.touches(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.touches "touches") / [`gm.crosses(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.crosses "crosses") / [`gm.overlaps(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.overlaps "overlaps") |
| `a.equals(b)` | [`gm.equals(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.equals "equals") |
| normalized equality | [`gm.equals_exact(a.normalize(), b.normalize())`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.equals_exact "equals_exact") |
| `a.relate(b)` / `a.relate_pattern(b, p)` | [`gm.relate(a, b)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.relate "relate") / [`gm.relate_pattern(a, b, p)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.relate_pattern "relate_pattern") |
| `shapely.contains_xy(g, x, y)` | [`gm.contains(g, x=x, y=y)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.contains "contains") |
| `shapely.intersects_xy(g, x, y)` | [`gm.intersects(g, x=x, y=y)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.intersects "intersects") |
| `a.dwithin(b, d)` | [`gm.dwithin(a, b, distance, unit=…)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.dwithin "dwithin") / [`idx.query(..., predicate="dwithin", distance=..., unit=...)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.query "query") |

### Measurement

| Shapely | gometry | Notes |
| --- | --- | --- |
| `geom.area` | [`geom.area`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.area "area property") / [`geoms.area`](https://gometry.monicz.dev/api/geometry/geometryarray/#gometry.GeometryArray.area "area property") | A `GeometryCollection` counts overlapping members once (the area of their union); Shapely sums member areas. |
| `geom.length` | [`geom.length`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.length "length property") / [`geoms.length`](https://gometry.monicz.dev/api/geometry/geometryarray/#gometry.GeometryArray.length "length property") | For a `GeometryCollection`, sums every member's length or perimeter, including overlaps; Shapely agrees. |
| `a.distance(b)` / `shapely.distance(a, b)` | [`gm.distance(a, b)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.distance "distance") |  |
| change the metric frame / units | [`geom.to_crs(target)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_crs "to_crs") / [`gm.area(geom, unit=…)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.area "area") |  |
| `minimum_clearance(g)` | [`g.minimum_clearance()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.minimum_clearance "minimum_clearance") |  |
| `hausdorff_distance` / `frechet_distance` | [`gm.hausdorff_distance(...)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.hausdorff_distance "hausdorff_distance") / [`gm.frechet_distance(...)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.frechet_distance "frechet_distance") | Planar Hausdorff uses a certified relative default; a supplied positive finite `max_error` is an absolute output-unit bound. Geographic Hausdorff measures point and linework supports over straight chart edges and requires `max_error` to be omitted. |

### Constructive operations

| Shapely | gometry | Notes |
| --- | --- | --- |
| `a.intersection(b)` / `shapely.intersection(a, b)` / `a & b` | [`gm.intersection(a, b)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.intersection "intersection") / `a & b` |  |
| `a.union(b)` / `shapely.union(a, b)` / `a \| b` | [`gm.union(a, b)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.union "union") / `a \| b` |  |
| `a.difference(b)` / `shapely.difference(a, b)` / `a - b` | [`gm.difference(a, b)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.difference "difference") / `a - b` |  |
| `a.symmetric_difference(b)` / `a ^ b` | [`gm.symmetric_difference(a, b)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.symmetric_difference "symmetric_difference") / `a ^ b` |  |
| `unary_union(geoms)` | [`gm.union_all(geoms)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.union_all "union_all") | Rejects conflicting CRS. |
| `intersection_all(geoms)` | [`gm.intersection_all(geoms)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.intersection_all "intersection_all") | Common region of all inputs. |
| `symmetric_difference_all(geoms)` | [`gm.symmetric_difference_all(geoms)`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.symmetric_difference_all "symmetric_difference_all") | Region in an odd number of inputs. |
| `geom.buffer(d)` / `shapely.buffer(geom, d)` | [`geom.buffer(d)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.buffer "buffer") | `quadrant_segments` corresponds to Shapely's `quad_segs` and GeoPandas' `resolution`; `miter_limit` corresponds to Shapely's `mitre_limit`. gometry defaults to 8 segments per quadrant; GeoPandas defaults to 16, so use `quadrant_segments=16` to retain that approximation. |
| `geom.buffer(d, single_sided=True)` | `geom.buffer(abs(d), side='left')` for positive `d`; `geom.buffer(abs(d), side='right')` for negative `d` | Sided buffers use flat ends and honor `join_style`, `quadrant_segments`, and `miter_limit`; gometry expresses the side explicitly and requires a non-negative distance. |
| `geom.simplify(t)` / `shapely.simplify(geom, t)` | [`geom.simplify(t)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.simplify "simplify") |  |
| `geom.offset_curve(d)` | [`geom.offset_curve(d)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.offset_curve "offset_curve") |  |
| rectangle intersection | [`gm.intersection(g, gm.box(..., crs=g.crs, epoch=g.epoch))`](https://gometry.monicz.dev/api/toplevel/overlay-dissolve/#gometry.intersection "intersection") | `west > east` selects a seam-crossing geographic box. |
| `geom.convex_hull` | [`geom.convex_hull()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.convex_hull "convex_hull") |  |
| `concave_hull(g, ratio=...)` | [`geom.concave_hull(concavity=..., length_threshold=...)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.concave_hull "concave_hull") | Different algorithm and knobs: `concavity` is an edge-length ratio, not Shapely's `ratio`. |
| `geom.centroid` / `geom.envelope` | `g.centroid()` / `g.envelope()` |  |
| `geom.point_on_surface()` | `g.point_on_surface()` |  |
| `polylabel(g)` | `g.polylabel()` | [Pole of inaccessibility](https://en.wikipedia.org/wiki/Pole_of_inaccessibility). |
| `maximum_inscribed_circle(g)` | `g.maximum_inscribed_circle()` | Returns a `Circle` solution: read `.center` and `.radius` from one solve, or call `.to_polygon()` for its contained polygonal realization. Shapely returns a center-to-boundary `LineString`. |
| `shortest_line(a, b)` | [`gm.shortest_line(a, b)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.shortest_line "shortest_line") | Connects the closest points. Its geographic chart-edge length can exceed their geodesic distance; compare using the same `unit=`. |
| `ops.nearest_points(a, b)` | [`gm.nearest_points(a, b)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.nearest_points "nearest_points") | The `(pa, pb)` pair behind `shortest_line`. |
| `delaunay_triangles(g)` | `g.triangulate(method='delaunay')` | Use `method='constrained'` for constrained edges or `method='earcut'` for polygon interiors. |
| Voronoi diagram output | [`g.voronoi()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.voronoi "voronoi") / `g.voronoi(output='edges')` | Use the `output` keyword to select cells or internal edges. |
| `shapely.ops.polygonize(...)` / `shapely.ops.polygonize_full(...)` | [`gm.polygonize_all(values)`](https://gometry.monicz.dev/api/toplevel/constructive-validation/#gometry.polygonize_all "polygonize_all"), with `diagnostics=True` for pooled cut edges, dangles, and invalid rings; `array.polygonize()` for independent rows | The pooled function accepts a `GeometryArray` directly and pools its present rows; see [geographic diagnostic semantics](https://gometry.monicz.dev/guide/constructive/#polygonize-diagnostics). |
| `build_area(...)` (GEOS) | `(...).build_area()` | Even-odd fill; unlike `polygonize`. |
| `node(...)` (GEOS 3.7+) | `(...).node()` | Noded linework as `MultiLineString`. |
| `line_merge(...)` | `(...).line_merge()` |  |
| `shared_paths(...)` | [`gm.shared_paths(...)`](https://gometry.monicz.dev/api/toplevel/constructive-validation/#gometry.shared_paths "shared_paths") |  |
| `snap(g, ref, tol)` | [`gm.snap(g, ref, tol)`](https://gometry.monicz.dev/api/toplevel/constructive-validation/#gometry.snap "snap") | GEOS's vertex pass moves at most one source vertex per reference vertex and requires distance `< tol`; gometry independently snaps every source vertex at distance `<= tol` to its nearest reference (ties by smallest X, then Y) and collapses consecutive equal-X/Y line coordinates. |
| `segmentize(g, max_len)` | `g.segmentize(max_len)` |  |
| `remove_repeated_points(...)` | `(...).remove_repeated_points()` |  |
| `minimum_rotated_rectangle(g)` | `g.minimum_rotated_rectangle()` |  |
| `geom.reverse()` / `shapely.reverse(geom)` | [`geom.reverse()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.reverse "reverse") |  |
| `orient(g)` | `g.orient_polygons()` |  |
| `normalize(g)` | `g.normalize()` |  |
| affine (`affinity.*`) | [`geom.translate(...)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.translate "translate") / `rotate(...)` / `scale(...)` / `skew(...)` / `affine_transform(...)` |  |

### Linear referencing

| Shapely | gometry | Notes |
| --- | --- | --- |
| `line.interpolate(d)` | `line.line_interpolate(d)` |  |
| `line.project(pt)` | `line.line_locate(pt)` |  |
| `substring(line, a, b)` | `line.line_substring(a, b)` |  |
| `split(geom, splitter)` | [`gm.split(geom, splitter)`](https://gometry.monicz.dev/api/toplevel/constructive-validation/#gometry.split "split") | Binary free function; array line inputs return one `Groups` row per source line. |

### Validation, repair, precision

| Shapely | gometry | Notes |
| --- | --- | --- |
| `geom.is_valid` | [`geom.is_valid`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_valid "is_valid property") | Unchanged; [`geom.validate()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.validate "validate") adds the reason/location. |
| `explain_validity(geom)` | `report.reason` / `report.location` |  |
| `make_valid(geom)` | [`geom.repair()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.repair "repair") |  |
| `set_precision(g, grid_size)` | [`geom.snap_to_grid(grid_size=..., repair=...)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.snap_to_grid "snap_to_grid") | Closest fixed-grid snap. `grid_size` must be positive and finite; unlike `coverage_clean(grid_size=0)`, zero is invalid. Optional `repair=`. JTS-style snap-rounding precision models are not supported. |
| — | [`geom.quantize(precision)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.quantize "quantize") | Decimal-place rounding of coordinates (different model from `set_precision`). |
| `require(...)` at boundary | [`gm.require(obj, crs=..., axes=...)`](https://gometry.monicz.dev/api/toplevel/constructive-validation/#gometry.require "require") | Storage contract. |
| `geom.is_empty` / `is_ring` / `is_simple` / `is_closed` | [`geom.is_empty`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_empty "is_empty property") / [`geom.is_ring`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_ring "is_ring property") / [`geom.is_simple`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_simple "is_simple property") / [`geom.is_closed`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_closed "is_closed property") |  |
| `is_ccw(ring)` | `g.is_ccw` / [`geom.is_ccw`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.is_ccw "is_ccw property") | Closed `LineString` winding. |
| `force_2d(g)` / `force_3d(g, z)` | `g.force_2d()` / `g.force_3d(z)` | `force_3d` fills only missing Z. Replace values everywhere with `g.with_coordinates(z=z, m=m)`; `None` clears an axis. |

### IO

| Shapely | gometry |
| --- | --- |
| [WKB](https://www.ogc.org/standard/sfa/) `from_wkb(b)` / `to_wkb(g)` | [`gm.from_wkb(b)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_wkb "from_wkb") / `g.to_wkb(include_srid=...)` |
| EWKB | `gm.from_wkb(b)` / `g.to_wkb(include_srid=True)` |
| [WKT](https://www.ogc.org/standard/sfa/) `from_wkt(s)` / `to_wkt(g)` | [`gm.from_wkt(s)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_wkt "from_wkt") / `g.to_wkt()` |
| [GeoJSON](https://datatracker.ietf.org/doc/html/rfc7946) | `gm.from_geojson(obj)` / `g.to_geojson()` |
| GeoJSON features w/ attributes | [`gm.from_geojson(fc, features=True)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_geojson "from_geojson") → validated [`Features`](https://gometry.monicz.dev/api/results/#gometry.Features "Features") record; serialize it with [`Features.__geo_interface__`](https://gometry.monicz.dev/ecosystem/text-formats/#features__geo_interface__), or use [`gm.to_feature_collection(geoms, properties=..., ids=...)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.to_feature_collection "to_feature_collection") for separate columns |
| `geom.__geo_interface__` | [`geom.__geo_interface__`](https://gometry.monicz.dev/ecosystem/text-formats/#__geo_interface__) |
| [GeoArrow](https://geoarrow.org/) | [`gm.from_arrow(obj)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_arrow "from_arrow") / [`geom.to_arrow()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_arrow "to_arrow") |
| `shapely.to_wkb(Point(...))` / `shapely.to_wkb(box(...))` | [`gm.Point(x, y).to_wkb(precision=...)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_wkb "to_wkb") / `gm.box(...).to_wkb(include_srid=..., precision=...)` |
| `shapely.to_wkt(Point(...))` / `shapely.to_wkt(box(...))` | [`gm.Point(x, y).to_wkt(precision=...)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_wkt "to_wkt") / `gm.box(...).to_wkt(precision=...)` |

Shapely's `to_wkt(output_dimension=2)` becomes `geom.force_2d().to_wkt()` in
gometry. Remove geometry axes before writing with `force_2d()`,
`with_coordinates(z=None)`, or `with_coordinates(m=None)`; use `coords.select(...)` to choose a coordinate-view layout
for coordinate exports without changing the geometry.

### Indexing & prepared

| Shapely | gometry | Notes |
| --- | --- | --- |
| `STRtree(geoms)` | [`gm.SpatialIndex(geoms)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex "SpatialIndex") |  |
| `tree.query(g)` | [`idx.candidates(g)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.candidates "candidates") |  |
| `tree.query(g, predicate=...)` | [`idx.query(g, predicate=...)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.query "query") |  |
| `tree.nearest(g)` | [`idx.nearest(g, unit=...)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.nearest "nearest") |  |
| `tree.query_nearest(g, exclusive=True)` | `idx.nearest(g, exclusive=True)` | skip self-matches |
| `prepare(g)` + predicate | `gm.<predicate>(g, geom)` or `idx.query(g, predicate=...)` | A geometry indexes itself once it is probed repeatedly. |

## pyproj

| pyproj | gometry | Notes |
| --- | --- | --- |
| `CRS.from_epsg(4326)` | [`gm.CRS(4326)`](https://gometry.monicz.dev/api/crs/#gometry.CRS "CRS") | CRS object; [`geom.crs`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.crs "crs property") returns one. |
| `gdf.set_crs(c)` | [`geom.with_crs(c)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.with_crs "with_crs") |  |
| `gdf.to_crs(c)` | [`geom.to_crs(c)`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_crs "to_crs") |  |
| `Transformer.from_crs(a, b)` + `.transform(x, y)` | [`gm.crs_transform(a, b, x, y, z=..., t=...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_transform "crs_transform") |  |
| `transformer.transform_bounds(...)` | [`gm.crs_transform_bounds(...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_transform_bounds "crs_transform_bounds") |  |
| `always_xy=True` | gometry X/Y coordinates |  |
| `query_utm_crs_info(...)` | [`geom.estimate_local_crs()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.estimate_local_crs "estimate_local_crs") / `geoms.estimate_local_crs()` | Scalar and array receiver methods → `CRS`. |
| polar/UPS selection | `geom.estimate_local_crs()` |  |
| `crs.is_geographic` / `is_projected` | [`gm.CRS(c).is_geographic`](https://gometry.monicz.dev/api/crs/#gometry.CRS.is_geographic "is_geographic property") / `.is_projected` | `is_*` property family. |
| `crs.axis_info` | [`gm.CRS(c).axis_order`](https://gometry.monicz.dev/api/crs/#gometry.CRS.axis_order "axis_order property") | Diagnostic only; boundary stays X/Y. |
| `crs.to_authority()` / `to_epsg()` | [`gm.CRS(c).to_authority()`](https://gometry.monicz.dev/api/crs/#gometry.CRS.to_authority "to_authority") / `.to_epsg()` |  |
| `crs.to_wkt()` / `to_proj4()` / `to_json()` | [`gm.CRS(c).to_wkt()`](https://gometry.monicz.dev/api/crs/#gometry.CRS.to_wkt "to_wkt") / `.to_proj()` / `.to_projjson()`; pass `as_dict=True` for a mapping |  |
| `crs == other` | `gm.CRS(c) == gm.CRS(other)` | Structural equality compares stored definitions; use `same_as` for operational equivalence. |
| `CRS.from_user_input(...)` normalize | [`gm.CRS(c).definition`](https://gometry.monicz.dev/api/crs/#gometry.CRS.definition "definition property") / [`gm.CRS(c).identify()`](https://gometry.monicz.dev/api/crs/#gometry.CRS.identify "identify") | `definition` retains normalized authored text; `identify()` supplies authority metadata. |
| `crs.to_2d()` / `to_3d()` | [`gm.CRS(c).to_2d()`](https://gometry.monicz.dev/api/crs/#gometry.CRS.to_2d "to_2d") / `.to_3d()` | Return a `CRS`. |
| unit / factors | [`gm.crs_unit(c)`](https://gometry.monicz.dev/api/crs/#gometry.crs_unit "crs_unit") / [`gm.crs_units(c)`](https://gometry.monicz.dev/api/crs/#gometry.crs_units "crs_units") / [`gm.CRS(c).factors(lon, lat)`](https://gometry.monicz.dev/api/crs/#gometry.CRS.factors "factors") |  |
| database / search | [`gm.crs_authorities()`](https://gometry.monicz.dev/api/crs/#gometry.crs_authorities "crs_authorities") / [`gm.crs_codes(...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_codes "crs_codes") / [`gm.crs_catalog(name=...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_catalog "crs_catalog") | Module-level `crs_*` functions. |
| catalogs | [`gm.crs_ellipsoids()`](https://gometry.monicz.dev/api/crs/#gometry.crs_ellipsoids "crs_ellipsoids") / [`gm.crs_prime_meridians()`](https://gometry.monicz.dev/api/crs/#gometry.crs_prime_meridians "crs_prime_meridians") / [`gm.crs_proj_operations()`](https://gometry.monicz.dev/api/crs/#gometry.crs_proj_operations "crs_proj_operations") / [`gm.crs_utm_zones(...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_utm_zones "crs_utm_zones") / [`gm.crs_celestial_bodies()`](https://gometry.monicz.dev/api/crs/#gometry.crs_celestial_bodies "crs_celestial_bodies") |  |
| operations | [`gm.CRS(a).operation(b)`](https://gometry.monicz.dev/api/crs/#gometry.CRS.operation "operation") / `.operations(b)` / `.operation(b, at=(x, y))` / [`gm.crs_apply(...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_apply "crs_apply") |  |
| grid lookup | [`gm.crs_grid(...)`](https://gometry.monicz.dev/api/crs/#gometry.crs_grid "crs_grid") | Local grid metadata and availability. |

### Geodesy (`Geod`)

| pyproj `Geod` | gometry (geometry on a geographic CRS) | Notes |
| --- | --- | --- |
| `g.inv(...)` distance | [`gm.distance(a, b)`](https://gometry.monicz.dev/api/toplevel/measurement/#gometry.distance "distance") |  |
| `g.inv(...)` azimuth | [`gm.bearing(a, b)`](https://gometry.monicz.dev/api/toplevel/geodesy-navigation/#gometry.bearing "bearing") |  |
| `g.inv(...)` back azimuth | `gm.bearing(b, a)` |  |
| `g.fwd(lon, lat, az, d)` | `point.destination(bearing, distance)` |  |
| `g.line_length(...)` | `line.length` |  |
| `g.geometry_area_perimeter(...)` | `poly.area` / `poly.length` |  |
| `g.npts(...)` | [`gm.point_between(a, b, 0.5, normalized=True)`](https://gometry.monicz.dev/api/toplevel/geodesy-navigation/#gometry.point_between "point_between") |  |
| geographic meter buffer | `point.buffer(meters)` on a geographic CRS (local-projection approximation) |  |
| non-WGS 84 ellipsoid | The same calls on points in that geographic CRS, e.g. `gm.Point(lon, lat, crs=4230)`; [`geom.area`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.area "area property") / [`geom.length`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.length "length property") likewise |  |

## h3-py

| h3-py | gometry | Notes |
| --- | --- | --- |
| `latlng_to_cell(lat, lng, r)` | [`gm.H3Cell(point, resolution=r)`](https://gometry.monicz.dev/api/h3/#gometry.H3Cell "H3Cell") |  |
| `cell_to_boundary(h)` | [`cell.polygon`](https://gometry.monicz.dev/api/grids/#gometry.Cell.polygon "polygon property") / [`cells.polygon`](https://gometry.monicz.dev/api/grids/#gometry.CellArray.polygon "polygon property readonly") |  |
| `polygon_to_cells(poly, r)` / `polyfill` | [`gm.h3_cover(geom, resolution=r, cell_rule="center")`](https://gometry.monicz.dev/api/h3/#gometry.h3_cover "h3_cover") |  |
| `compact_cells` / `uncompact_cells` | `cells.compact()` / `cells.uncompact(r)` |  |
| per-point membership | [`gm.covers(geom, points)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.covers "covers") |  |

## s2sphere

| s2sphere | gometry | Notes |
| --- | --- | --- |
| `CellId.from_lat_lng(...).parent(level)` | [`gm.S2Cell(point, level=...)`](https://gometry.monicz.dev/api/s2/#gometry.S2Cell "S2Cell") |  |
| `Cell(cell_id)` boundary | [`cell.polygon`](https://gometry.monicz.dev/api/grids/#gometry.Cell.polygon "polygon property") / [`cells.polygon`](https://gometry.monicz.dev/api/grids/#gometry.CellArray.polygon "polygon property readonly") |  |
| `RegionCoverer().get_covering(region)` | [`gm.s2_cover(geom, ...)`](https://gometry.monicz.dev/api/s2/#gometry.s2_cover "s2_cover") | `target_cells` guides refinement; `max_cells` is the hard output cap. |
| `RegionCoverer(min_level=L, max_level=L).get_covering(region)` | [`gm.s2_cover(geom, level=L, max_cells=...)`](https://gometry.monicz.dev/api/s2/#gometry.s2_cover "s2_cover") | The requested level is never coarsened. |
| `CellUnion` set ops | [`gm.s2_union(a, b)`](https://gometry.monicz.dev/api/s2/#gometry.s2_union "s2_union") / [`gm.s2_intersection(a, b)`](https://gometry.monicz.dev/api/s2/#gometry.s2_intersection "s2_intersection") / [`gm.s2_difference(a, b)`](https://gometry.monicz.dev/api/s2/#gometry.s2_difference "s2_difference") |  |
| `CellUnion.normalize()` / expand | `cells.compact()` / `cells.uncompact(level)` |  |
| geometry membership | [`gm.covers(geometry, probe)`](https://gometry.monicz.dev/api/toplevel/predicates/#gometry.covers "covers") |  |

## rtree / STRtree / GeoPandas

| Old | gometry | Notes |
| --- | --- | --- |
| `rtree.index.Index()` + `insert(id, bbox)` | [`gm.SpatialIndex(geoms)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex "SpatialIndex") | Geometry-aware, bulk-loaded. |
| `list(idx.intersection(bbox))` | [`idx.candidates(geom)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.candidates "candidates") |  |
| candidates + manual refine | [`idx.query(geom, predicate=...)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.query "query") |  |
| `idx.nearest(bbox, n)` | [`idx.nearest(geom, k=n, unit=...)`](https://gometry.monicz.dev/api/spatial-index/#gometry.SpatialIndex.nearest "nearest") |  |
| `STRtree(geoms)` | `gm.SpatialIndex(geoms)` |  |
| `geopandas.sjoin(a, b, predicate=...)` | [`gm.join(a, b, predicate=...)`](https://gometry.monicz.dev/api/toplevel/index-join/#gometry.join "join") |  |

## python-geohash / pygeohash

| Old | gometry | Notes |
| --- | --- | --- |
| `geohash.encode(lat, lon, precision=p)` | [`gm.GeohashCell(lon, lat, precision=p).token`](https://gometry.monicz.dev/api/geohash/#gometry.GeohashCell "GeohashCell") |  |
| `geohash.decode(token)` | [`cell.center`](https://gometry.monicz.dev/api/grids/#gometry.Cell.center "center property") |  |
| `geohash.bbox(token)` | [`cell.polygon.bounds`](https://gometry.monicz.dev/api/grids/#gometry.Cell.polygon "polygon property") |  |
| `geohash.neighbors(token)` | [`cell.neighbors`](https://gometry.monicz.dev/api/grids/#gometry.Cell.neighbors "neighbors property") | 8-neighborhood, seam-wrapping. |
| coverage of a polygon | [`gm.geohash_cover(geom, precision=p)`](https://gometry.monicz.dev/api/geohash/#gometry.geohash_cover "geohash_cover") |  |

## mercantile

| mercantile | gometry | Notes |
| --- | --- | --- |
| `mercantile.tile(lng, lat, zoom)` | [`gm.Tile(lon=lng, lat=lat, zoom=z)`](https://gometry.monicz.dev/api/tiles/#gometry.Tile "Tile") | Typed `Tile` with `.zoom/.x/.y`. |
| `mercantile.quadkey(tile)` | `tile.token` |  |
| `mercantile.quadkey_to_tile(qk)` | `gm.Tile(qk)` |  |
| `mercantile.bounds(tile)` | `tile.polygon.bounds` | Tile footprint bounds. |
| `mercantile.parent/children(tile)` | `tile.parent()` / `tile.children()` |  |
| `mercantile.tiles(*bbox, zooms)` | [`gm.tile_cover(geom, zoom=z)`](https://gometry.monicz.dev/api/tiles/#gometry.tile_cover "tile_cover") |  |

## polyline / openlocationcode / OSM shortlink

| Old | gometry | Notes |
| --- | --- | --- |
| `polyline.decode(s)` | [`gm.from_polyline(s)`](https://gometry.monicz.dev/api/toplevel/io-interop/#gometry.from_polyline "from_polyline") | Returns a `Point` for one coordinate, otherwise a `LineString` (or array). |
| `polyline.encode(coords)` | `line.to_polyline()` / [`geom.to_polyline()`](https://gometry.monicz.dev/api/geometry/geometry/#gometry.Geometry.to_polyline "to_polyline") |  |
| `openlocationcode.encode(lat, lng)` | [`gm.pluscode_encode(lng, lat)`](https://gometry.monicz.dev/api/geocode/#gometry.pluscode_encode "pluscode_encode") |  |
| `openlocationcode.decode(code)` | [`gm.pluscode_polygon(code)`](https://gometry.monicz.dev/api/geocode/#gometry.pluscode_polygon "pluscode_polygon") | Returns the cell `Polygon`. |
| `shorten` / `recoverNearest` | [`gm.pluscode_shorten`](https://gometry.monicz.dev/api/geocode/#gometry.pluscode_shorten "pluscode_shorten") / [`gm.pluscode_recover`](https://gometry.monicz.dev/api/geocode/#gometry.pluscode_recover "pluscode_recover") |  |
| OSM `ShortLink.encode/decode` | [`gm.osm_shortlink_encode`](https://gometry.monicz.dev/api/geocode/#gometry.osm_shortlink_encode "osm_shortlink_encode") / [`gm.osm_shortlink_location`](https://gometry.monicz.dev/api/geocode/#gometry.osm_shortlink_location "osm_shortlink_location") | Legacy `@` accepted. |

## scikit-learn / scipy clustering

| Old | gometry | Notes |
| --- | --- | --- |
| `DBSCAN(...).fit(coords)` / k-means / hierarchical clustering | feed `np.asarray(geom.coords, dtype=np.float64)` (or `.coords.x`/`.y`) to scikit-learn / scipy | gometry stays a geometry engine; cluster in coordinate space via NumPy handoff. |
| scattered-data interpolation (IDW, kriging, …) | scipy / scikit-gstat over `np.asarray(geom.coords, dtype=np.float64)` | Project to a suitable CRS first when planar XY is wrong. |
