CRS¶
Coordinate reference systems, transformations, catalogs, and grid resources.
Related: CRS, units & measurement
CRS object¶
CRS
¶
Accepted call forms
CRS(value: CrsInput) -> CRS
Coordinate reference system.
A PROJ-backed CRS object: introspect it (crs.is_geographic,
crs.ellipsoid), serialize it (crs.to_wkt(), crs.to_epsg()),
evaluate it (crs.factors(...)), assign it to geometries with
with_crs, or transform coordinates with to_crs. Accepts an authority
string, EPSG code, authority tuple, PROJJSON/CF mapping, WKT/PROJ string,
or another CRS.
Equality is structural between CRS instances: the stored normalized
definitions must match. Other operand types do not compare equal; use
CRS(value) when comparing stored identity with raw input. Operational
equivalence, including axis-order-only differences, is the explicit
same_as(..., mode='ignore_axis_order') query. Equal CRS values are
hashable and can be used as mapping keys.
Build a CRS from any accepted input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
CrsInput
|
Authority string, EPSG code, authority tuple, PROJJSON/CF mapping,
WKT/PROJ string, CRS-holder object, or another |
required |
Returns:
| Type | Description |
|---|---|
CRS
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If the value is not a recognized CRS. |
area_of_use
property
¶
area_of_use: CrsAreaOfUse | None
Area of use as a {west, south, east, north, name} dict, or None.
Returns:
| Type | Description |
|---|---|
CrsAreaOfUse or None
|
|
authority
property
¶
authority: str | None
Registry authority (e.g. "EPSG"), if identified.
Returns:
| Type | Description |
|---|---|
str or None
|
|
axes
property
¶
axes: list[CrsAxisInfo]
Coordinate-system axes as a list of dicts.
Returns:
| Type | Description |
|---|---|
list of CrsAxisInfo
|
|
axis_order
property
¶
axis_order: list[str]
Axis roles in CRS order (lowercase, e.g. ["lat", "lon"] for a
lat/lon CRS; tokens "lat"/"lon"/"x"/"y"/"z"/
"height"/"other"). For the raw PROJ abbreviations use axes.
Returns:
| Type | Description |
|---|---|
list of str
|
|
celestial_body
property
¶
celestial_body: str | None
Name of the celestial body (usually "Earth"), if known.
Returns:
| Type | Description |
|---|---|
str or None
|
|
code
property
¶
code: str | None
Authority code (e.g. "4326"), if identified.
Returns:
| Type | Description |
|---|---|
str or None
|
|
datum
property
¶
datum: CrsDatumInfo | None
Geodetic datum as a dict, or None.
Returns:
| Type | Description |
|---|---|
CrsDatumInfo or None
|
|
definition
property
¶
definition: str
Stored definition string for this CRS.
Returns:
| Type | Description |
|---|---|
str
|
|
ellipsoid
property
¶
ellipsoid: CrsEllipsoidInfo | None
Reference ellipsoid as a dict, or None.
Returns:
| Type | Description |
|---|---|
CrsEllipsoidInfo or None
|
|
geodetic_crs
property
¶
geodetic_crs: CrsAuthorityObject | None
Underlying geodetic CRS as an authority-object dict, or None.
Returns:
| Type | Description |
|---|---|
CrsAuthorityObject or None
|
|
geoid_models
property
¶
geoid_models: list[str]
Geoid model names available for this CRS.
Returns:
| Type | Description |
|---|---|
list of str
|
|
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).geoid_models
[]
info
property
¶
info: CrsInfo
Full raw PROJ description as a dict (escape hatch).
Returns:
| Type | Description |
|---|---|
CrsInfo
|
|
is_bound
property
¶
is_bound: bool
Whether this CRS is a bound CRS (carries a datum transform).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_compound
property
¶
is_compound: bool
Whether this CRS is compound (horizontal + vertical).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_deprecated
property
¶
is_deprecated: bool
Whether this CRS is flagged deprecated by its authority.
Returns:
| Type | Description |
|---|---|
bool
|
|
is_derived
property
¶
is_derived: bool
Whether this CRS is derived from a base CRS.
Returns:
| Type | Description |
|---|---|
bool
|
|
is_engineering
property
¶
is_engineering: bool
Whether this CRS is engineering (local/non-geodetic).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_geocentric
property
¶
is_geocentric: bool
Whether this CRS is geocentric (earth-centered Cartesian).
For a compound CRS this is True when any component is
geocentric (not root-kind only).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_geographic
property
¶
is_geographic: bool
Whether this CRS is geographic (lon/lat on an ellipsoid).
For a compound CRS this is True when any component is
geographic (not root-kind only) — e.g. EPSG:9707 (WGS 84 + height).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_projected
property
¶
is_projected: bool
Whether this CRS is projected (planar, metric).
For a compound CRS this is True when any component is
projected (not root-kind only).
Returns:
| Type | Description |
|---|---|
bool
|
|
is_vertical
property
¶
is_vertical: bool
Whether this CRS is vertical (height/depth only).
For a compound CRS this is True when any component is
vertical (not root-kind only).
Returns:
| Type | Description |
|---|---|
bool
|
|
kind
property
¶
kind: Literal['geographic_2d', 'geographic_3d', 'geographic', 'geocentric', 'projected', 'vertical', 'compound', 'temporal', 'engineering', 'bound', 'other', 'unknown']
CRS kind as a snake_case token ("geographic_2d", "geographic_3d",
"projected", "geocentric", "vertical", "compound",
"bound", "other", ...).
Returns:
| Type | Description |
|---|---|
str
|
|
name
property
¶
name: str | None
Human-readable CRS name, if known.
Returns:
| Type | Description |
|---|---|
str or None
|
|
non_deprecated
property
¶
non_deprecated: list[CrsAuthorityObject]
Non-deprecated authority objects equivalent to this CRS.
Returns:
| Type | Description |
|---|---|
list of CrsAuthorityObject
|
|
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).non_deprecated
[]
prime_meridian
property
¶
prime_meridian: CrsPrimeMeridianInfo | None
Prime meridian as a dict, or None.
Returns:
| Type | Description |
|---|---|
CrsPrimeMeridianInfo or None
|
|
factors
¶
Accepted call forms
factors(lon: FloatScalar | ScalarFloatArray, lat: FloatScalar | ScalarFloatArray, *, radians: bool = False) -> CrsProjectionFactors
factors(lon: FloatInput, lat: FloatInput, *, radians: bool = False) -> CrsProjectionFactorsBatch
Map-projection factors (scale, distortion, Tissot, …) at a lon/lat.
For a projected CRS the evaluation point is geographic lon/lat on the base ellipsoid and the returned scales/distortions describe the projection at that location. For a pure geographic CRS the factors are near-identity (meridional/parallel scale ≈ 1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lon
|
float or sequence of float
|
Longitude of the evaluation point(s), degrees unless
|
required |
lat
|
float or sequence of float
|
Latitude of the evaluation point(s), degrees unless
|
required |
radians
|
bool
|
Interpret angular inputs as radians (default |
False
|
Returns:
| Type | Description |
|---|---|
dict
|
Scalar call: mapping of factor names to floats
( |
Raises:
| Type | Description |
|---|---|
InvalidGeometryError
|
If |
Examples:
>>> import gometry as gm
>>> f = gm.CRS(3857).factors(0.0, 0.0)
>>> round(f['meridional_scale'], 5)
1.0
identify
¶
identify(*, authority: str | None = None) -> list[CrsIdentifyCandidate]
Candidate authority matches for this CRS, best first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Restrict matches to this authority. |
None
|
Returns:
| Type | Description |
|---|---|
list of CrsIdentifyCandidate
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If identification fails. |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).identify()[0]['code']
'4326'
operation
¶
operation(target: CrsInput, *, at: tuple[float, float] | tuple[float, float, float] | tuple[float, float, float, float] | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> CrsOperationInfo
Best coordinate operation from this CRS to target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
CRS - like
|
Destination CRS. |
required |
at
|
tuple of float
|
Coordinate at which to select the best operation: |
None
|
area_of_interest
|
sequence of float
|
|
None
|
source_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
target_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
authority
|
str
|
Restrict candidate coordinate operations to this authority
(e.g. |
None
|
accuracy
|
float
|
Maximum acceptable operation accuracy, in meters. |
None
|
allow_ballpark
|
bool
|
Allow low-accuracy ballpark operations when no precise one exists. |
None
|
only_best
|
bool
|
Require PROJ's best operation. If a required transformation grid is
unavailable, raise |
None
|
force_over
|
bool
|
Keep coordinates on the source side of the antimeridian instead of
wrapping into |
False
|
Returns:
| Type | Description |
|---|---|
CrsOperationInfo
|
The operation or a nested step's |
Raises:
| Type | Description |
|---|---|
CRSError
|
If the CRS arguments are unrecognized. |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).operation(3857)['name']
'pipeline'
operations
¶
operations(target: CrsInput, *, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> list[CrsOperationInfo]
All candidate operations from this CRS to target, best first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
CRS - like
|
Destination CRS. |
required |
area_of_interest
|
sequence of float
|
|
None
|
source_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
target_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
authority
|
str
|
Restrict candidate coordinate operations to this authority
(e.g. |
None
|
accuracy
|
float
|
Maximum acceptable operation accuracy, in meters. |
None
|
allow_ballpark
|
bool
|
Allow low-accuracy ballpark operations when no precise one exists. |
None
|
only_best
|
bool
|
Require PROJ's best operation. If a required transformation grid is
unavailable, raise |
None
|
force_over
|
bool
|
Keep coordinates on the source side of the antimeridian instead of
wrapping into |
False
|
Returns:
| Type | Description |
|---|---|
list of CrsOperationInfo
|
A candidate's or nested step's |
Examples:
>>> import gometry as gm
>>> len(gm.CRS(4326).operations(3857)) >= 1
True
same_as
¶
same_as(other: CrsInput, *, mode: Literal['ignore_axis_order', 'exact']) -> bool
Test whether this CRS describes the same system as other.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
CRS - like
|
The other CRS-like value to compare against. |
required |
mode
|
str
|
One of |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).same_as(gm.CRS(4326), mode='exact')
True
to_2d
¶
to_2d(*, name: str | None = None) -> CRS
Return the 2D (horizontal) form of this CRS.
Converts the CRS definition by removing the ellipsoidal-height axis;
it does not add or remove Z ordinates on geometries — use
force_2d/force_3d or with_coordinates(z=...) for that.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name for the derived CRS. |
None
|
Returns:
| Type | Description |
|---|---|
CRS
|
|
Examples:
>>> import gometry as gm
>>> gm.CRS(4979).to_2d().to_epsg()
4326
to_3d
¶
to_3d(*, name: str | None = None) -> CRS
Return the 3D form of this CRS (adds an ellipsoidal height axis).
Converts the CRS definition only; it does not add or remove Z
ordinates on geometries — use force_2d/force_3d or with_coordinates(z=...) for
that.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name for the derived CRS. |
None
|
Returns:
| Type | Description |
|---|---|
CRS
|
|
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_3d().to_epsg()
4979
to_authority
¶
to_authority(*, authority: str | None = None, min_confidence: int = 70) -> tuple[str, str] | None
(authority, code) pair, or None if it cannot be determined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Restrict identification to this authority. |
None
|
min_confidence
|
int
|
Minimum identification confidence (0-100, default 70). |
70
|
Returns:
| Type | Description |
|---|---|
tuple or None
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_authority()
('EPSG', '4326')
to_cf
¶
to_cf(*, wkt_version: Literal['WKT2_2019', 'WKT2_2019_SIMPLIFIED', 'WKT2_2015', 'WKT2_2015_SIMPLIFIED', 'WKT1_GDAL', 'WKT1_ESRI'] = 'WKT2_2019') -> CrsCfInfo
CF (Climate and Forecast) grid-mapping attributes as a dict.
Projected units is m, ft, or us-ft when every horizontal
axis admits the same token. Otherwise the reconstructible grid mapping
and units are omitted; crs_wkt still carries the full CRS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wkt_version
|
str
|
WKT dialect embedded in |
'WKT2_2019'
|
Returns:
| Type | Description |
|---|---|
CrsCfInfo
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If export fails. |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_cf().get('grid_mapping_name')
'latitude_longitude'
to_epsg
¶
to_epsg(*, min_confidence: int = 70) -> int | None
EPSG integer code, or None if it cannot be determined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
min_confidence
|
int
|
Minimum identification confidence (0-100, default 70). |
70
|
Returns:
| Type | Description |
|---|---|
int or None
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_epsg()
4326
to_proj
¶
to_proj(*, version: Literal[4, 5] = 5, pretty: bool = False, approximate_tmerc: bool = False, indentation_width: int = 2, max_line_length: int = 80) -> str
Serialize this CRS to a PROJ string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
int
|
PROJ string version (4 or 5). |
5
|
pretty
|
bool
|
Indent the output (default |
False
|
approximate_tmerc
|
bool
|
Use the approximate transverse-Mercator formulation. |
False
|
indentation_width
|
int
|
Spaces per indent level when |
2
|
max_line_length
|
int
|
Wrap lines at this width. |
80
|
Returns:
| Type | Description |
|---|---|
str
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If export fails or a formatting option is invalid. |
Examples:
>>> import gometry as gm
>>> '+proj=longlat' in gm.CRS(4326).to_proj()
True
to_projjson
¶
Accepted call forms
to_projjson(*, as_dict: Literal[False] = False, pretty: bool = False, indentation_width: int = 2) -> str
to_projjson(*, as_dict: Literal[True]) -> dict[str, object]
to_projjson(*, as_dict: bool, pretty: bool = False, indentation_width: int = 2) -> str | dict[str, object]
Export this CRS as PROJJSON text or a fresh Python mapping.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
as_dict
|
bool
|
Return a Python mapping; the JSON-text form omits |
required |
pretty
|
bool
|
Indent JSON text (default |
False
|
indentation_width
|
int
|
Spaces per indent level for pretty JSON text; available only when
|
2
|
Returns:
| Type | Description |
|---|---|
str or dict[str, object]
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If export fails or a formatting option is invalid. |
GeometryError
|
If formatting is requested with |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_projjson(as_dict=True)['type']
'GeographicCRS'
to_wkt
¶
to_wkt(*, version: Literal['WKT2_2019', 'WKT2_2019_SIMPLIFIED', 'WKT2_2015', 'WKT2_2015_SIMPLIFIED', 'WKT1_GDAL', 'WKT1_ESRI'] = 'WKT2_2019', pretty: bool = False, output_axis: Literal['auto', 'yes', 'no'] = 'auto', strict: bool = True, indentation_width: int = 4) -> str
Serialize this CRS to WKT.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str
|
WKT dialect (default |
'WKT2_2019'
|
pretty
|
bool
|
Indent the WKT output (default |
False
|
output_axis
|
str
|
Axis-output policy ( |
"auto"
|
strict
|
bool
|
Fail on lossy output (default |
True
|
indentation_width
|
int
|
Spaces per indent level when |
4
|
Returns:
| Type | Description |
|---|---|
str
|
|
Raises:
| Type | Description |
|---|---|
CRSError
|
If export fails or a formatting option is invalid. |
Examples:
>>> import gometry as gm
>>> gm.CRS(4326).to_wkt().startswith('GEOGCRS')
True
CRS functions¶
crs_apply
¶
Accepted call forms
crs_apply(operation: str, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: None = None, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[float, float]
crs_apply(operation: str, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: FloatScalar | ScalarFloatArray, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[float, float, float]
crs_apply(operation: str, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: None = None, *, t: FloatScalar | ScalarFloatArray, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[float, float, float]
crs_apply(operation: str, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: FloatScalar | ScalarFloatArray, *, t: FloatScalar | ScalarFloatArray, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[float, float, float, float]
crs_apply(operation: str, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: None = None, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: None = None, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: FloatInput, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: FloatInput, *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatInput, z: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], *, t: None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: None = None, *, t: FloatInput, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: None = None, *, t: FloatInput, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatInput, z: None = None, *, t: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: FloatInput, *, t: FloatInput, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: FloatInput, *, t: FloatInput, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatInput, z: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], *, t: FloatInput, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatInput, z: FloatInput, *, t: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], direction: Literal['forward', 'inverse'] = 'forward') -> tuple[NDArray[float64], NDArray[float64], NDArray[float64], NDArray[float64]]
crs_apply(operation: str, x: FloatInput, y: FloatInput, z: FloatInput | None = None, *, t: FloatInput | None = None, direction: Literal['forward', 'inverse'] = 'forward') -> tuple[float, float] | tuple[float, float, float] | tuple[float, float, float, float] | tuple[NDArray[float64], NDArray[float64]] | tuple[NDArray[float64], NDArray[float64], NDArray[float64]] | tuple[NDArray[float64], NDArray[float64], NDArray[float64], NDArray[float64]]
Apply a PROJ pipeline/operation definition to coordinates.
Runs an explicit operation (e.g. a
+proj=pipeline string) rather than resolving one from a CRS pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operation
|
str
|
PROJ operation or pipeline definition. |
required |
x
|
float or sequence of float
|
Coordinate columns (scalars transform a single point). |
required |
y
|
float or sequence of float
|
Coordinate columns (scalars transform a single point). |
required |
z
|
float or sequence of float
|
Vertical column for 3D operations. |
None
|
t
|
float or sequence of float
|
Coordinate epoch column. |
None
|
direction
|
('forward', 'inverse')
|
Operation direction. |
'forward'
|
Returns:
| Type | Description |
|---|---|
tuple
|
The transformed columns — |
Raises:
| Type | Description |
|---|---|
TransformError
|
If no transform exists between the frames or it fails to apply. |
CRSError
|
If the operation definition is invalid. |
InvalidGeometryError
|
If coordinate columns are non-finite or differ in length. |
GeometryError
|
If |
Notes
Supply a literal operation definition. A definition returned by
CRS.operation may be None when selected angular semantics cannot be
represented faithfully as an executable PROJ string.
Examples:
>>> import gometry as gm
>>> op = '+proj=affine +xoff=1 +yoff=2'
>>> gm.crs_apply(op, -122.4, 37.8)
(-121.4, 39.8)
crs_authorities
¶
crs_authorities() -> list[str]
Names of all registry authorities known to PROJ.
Returns:
| Type | Description |
|---|---|
list of str
|
|
Examples:
>>> import gometry as gm
>>> gm.crs_authorities()[:3]
['EPSG', 'ESRI', 'IAU_2015']
crs_cache_info
¶
crs_cache_info() -> CrsCacheInfo
Statistics about the CRS caches.
Returns:
| Type | Description |
|---|---|
dict
|
CRS cache statistics (generation, entry counts, per-bucket info). |
Examples:
>>> import gometry as gm
>>> gm.crs_cache_info()['total_capacity'] > 0
True
crs_catalog
¶
crs_catalog(name: str | None = None, *, authority: str | None = None, kind: Literal['crs', 'geodetic', 'geographic', 'geographic_2d', 'geographic_3d', 'geocentric', 'projected', 'vertical', 'compound', 'temporal', 'engineering', 'bound', 'other'] | None = None, area_of_interest: CrsAreaInput | None = None, contains_area_of_interest: bool = False, allow_deprecated: bool = False, celestial_body: str | None = None, approximate: bool = False, limit: int | None = None) -> list[CrsCatalogInfo]
Catalog of CRS in the database matching the given filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Match CRS names using PROJ's database name matcher. |
None
|
authority
|
str
|
Registry authority to search (default |
None
|
kind
|
str
|
Restrict to a CRS kind. |
None
|
area_of_interest
|
sequence of float, dict, or object
|
Filter area as |
None
|
contains_area_of_interest
|
bool
|
Require the CRS area to contain |
False
|
allow_deprecated
|
bool
|
Include deprecated CRS (default |
False
|
celestial_body
|
str
|
Restrict to this celestial body. |
None
|
approximate
|
bool
|
Allow approximate matching when |
False
|
limit
|
int
|
Maximum number of returned records; omitted means no result limit. |
None
|
Returns:
| Type | Description |
|---|---|
list of CrsCatalogInfo
|
|
Examples:
>>> import gometry as gm
>>> any(item['crs'] == 'EPSG:4326' for item in gm.crs_catalog(name='WGS 84'))
True
crs_celestial_bodies
¶
crs_celestial_bodies(*, authority: str | None = None) -> list[CrsCelestialBodyInfo]
Celestial bodies known to the CRS database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Restrict to this authority. |
None
|
Returns:
| Type | Description |
|---|---|
list of CrsCelestialBodyInfo
|
|
Examples:
>>> import gometry as gm
>>> gm.crs_celestial_bodies()[0]['name']
'1_Ceres'
crs_clear_cache
¶
crs_clear_cache() -> None
Clear the CRS object cache.
Returns:
| Type | Description |
|---|---|
None
|
|
Examples:
>>> import gometry as gm
>>> gm.crs_clear_cache()
>>> True
True
crs_codes
¶
crs_codes(authority: str, *, kind: CrsDatabaseKind | None = None, allow_deprecated: bool = False) -> list[str]
Object codes within a registry authority.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Registry authority, e.g. |
required |
kind
|
str
|
Restrict to a CRS kind. |
None
|
allow_deprecated
|
bool
|
Include deprecated codes (default |
False
|
Returns:
| Type | Description |
|---|---|
list of str
|
|
Examples:
>>> import gometry as gm
>>> gm.crs_codes('EPSG')[:3]
['10150', '10151', '10156']
crs_configure
¶
crs_configure(*, search_paths: str | PathLike[str] | Iterable[str | PathLike[str]] | None = ..., user_writable_directory: str | PathLike[str] | None = ...) -> CrsRuntimeConfig
Configure local CRS engine paths.
Omitted arguments keep their current value, while explicit None restores
that field's default. A call without arguments returns the current
configuration unchanged; use crs_reset to restore both defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
search_paths
|
str, path, or sequence of these
|
Directories PROJ searches for its database and grids. |
...
|
user_writable_directory
|
str or path
|
Directory PROJ includes in local grid lookup. |
...
|
Notes
The configured directories are not an exclusive grid-file whitelist. A
grid in the current working directory can therefore change grid
availability, the selected transformation, and whether AccuracyWarning
is emitted after the configured directories miss.
Returns:
| Type | Description |
|---|---|
dict
|
The effective configuration after applying the changes. |
Examples:
>>> import gometry as gm
>>> isinstance(gm.crs_configure(), dict)
True
crs_ellipsoids
¶
crs_ellipsoids() -> list[CrsEllipsoidCatalogInfo]
List ellipsoids in the CRS database.
Returns:
| Type | Description |
|---|---|
list
|
One entry per ellipsoid in the CRS database. |
Examples:
>>> import gometry as gm
>>> gm.crs_ellipsoids()[0]['id']
'MERIT'
crs_engine
¶
crs_engine() -> CrsEngineInfo
Name/version of the underlying CRS engine (PROJ).
Returns:
| Type | Description |
|---|---|
dict
|
Engine metadata. |
Examples:
>>> import gometry as gm
>>> gm.crs_engine()['version']
'9.9.0'
crs_grid
¶
crs_grid(name: str) -> CrsGridDatabaseInfo
Information about a transformation grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Grid short name (e.g. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Local grid metadata and availability. |
Examples:
>>> import gometry as gm
>>> gm.crs_grid('null')['available']
True
crs_prime_meridians
¶
crs_prime_meridians() -> list[CrsPrimeMeridianCatalogInfo]
List prime meridians in the CRS database.
Returns:
| Type | Description |
|---|---|
list
|
One entry per prime meridian in the CRS database. |
Examples:
>>> import gometry as gm
>>> gm.crs_prime_meridians()[0]['id']
'greenwich'
crs_proj_operations
¶
crs_proj_operations() -> list[CrsProjOperationCatalogInfo]
List PROJ operations available.
Returns:
| Type | Description |
|---|---|
list
|
One entry per available PROJ operation. |
Examples:
>>> import gometry as gm
>>> gm.crs_proj_operations()[0]['id']
'adams_hemi'
crs_reset
¶
crs_reset() -> CrsRuntimeConfig
Reset CRS engine configuration to defaults.
Returns:
| Type | Description |
|---|---|
dict
|
The configuration after the reset. |
Examples:
>>> import gometry as gm
>>> isinstance(gm.crs_reset(), dict)
True
crs_roundtrip
¶
Accepted call forms
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: FloatScalar | ScalarFloatArray | None = None, *, t: FloatScalar | ScalarFloatArray | None = None, iterations: int | integer[Any] = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> float
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: FloatInput | None = None, *, t: FloatInput | None = None, iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: FloatInput | None = None, *, t: FloatInput | None = None, iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: FloatInput | None = None, *, t: FloatInput | None = None, iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], *, t: FloatInput | None = None, iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatInput | None = None, *, t: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_roundtrip(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatInput | None = None, *, t: FloatInput | None = None, iterations: int = 1, direction: Literal['forward', 'inverse'] = 'forward', area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> float | NDArray[float64]
Round-trip coordinates through a CRS pair to measure error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
CRS - like
|
Source and destination CRS-like inputs. |
required |
target
|
CRS - like
|
Source and destination CRS-like inputs. |
required |
x
|
float or sequence of float
|
Coordinates, scalar or batch. |
required |
y
|
float or sequence of float
|
Coordinates, scalar or batch. |
required |
z
|
float or sequence of float
|
Height and time ordinates when provided. |
None
|
t
|
float or sequence of float
|
Height and time ordinates when provided. |
None
|
iterations
|
int
|
How many forward+inverse passes to apply. |
1
|
direction
|
('forward', 'inverse')
|
Which leg runs first. |
'forward'
|
area_of_interest
|
sequence of float, dict, or object
|
Area of interest guiding operation selection, as
|
None
|
source_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
target_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
authority
|
str
|
Restrict candidate coordinate operations to this authority
(e.g. |
None
|
accuracy
|
float
|
Maximum acceptable operation accuracy, in meters. |
None
|
allow_ballpark
|
bool
|
Allow low-accuracy ballpark operations when no precise one exists. |
None
|
only_best
|
bool
|
Require PROJ's best operation. If a required transformation grid is
unavailable, raise |
None
|
force_over
|
bool
|
Keep coordinates on the source side of the antimeridian instead of
wrapping into |
False
|
Returns:
| Type | Description |
|---|---|
float or ndarray
|
Euclidean residual of the raw input columns in their original units
after the out-and-back legs. When Z or T is present the hypot mixes
those column units with X and Y. There is no geodesic distance and no
circular-longitude normalization. Scalar in, scalar out, and lane
inputs return a read-only |
Raises:
| Type | Description |
|---|---|
TransformError
|
If no transform exists between the frames or it fails to apply. |
CRSError
|
If |
InvalidGeometryError
|
If coordinate columns are non-finite or differ in length. |
GeometryError
|
If an epoch option is invalid. |
Examples:
>>> import gometry as gm
>>> gm.crs_roundtrip(4326, 3857, -122.4, 37.8) < 1e-9
True
crs_transform
¶
Accepted call forms
crs_transform(source: CrsInput, target: CrsInput, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: None = None, *, t: FloatScalar | ScalarFloatArray | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float]
crs_transform(source: CrsInput, target: CrsInput, x: FloatScalar | ScalarFloatArray, y: FloatScalar | ScalarFloatArray, z: FloatScalar | ScalarFloatArray, *, t: FloatScalar | ScalarFloatArray | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float, float]
crs_transform(source: CrsInput, target: CrsInput, x: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], y: FloatInput, z: FloatInput | None = None, *, t: FloatInput | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_transform(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], z: FloatInput | None = None, *, t: FloatInput | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_transform(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], *, t: FloatInput | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_transform(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatInput | None = None, *, t: FloatColumn | ndarray[tuple[int], dtype[floating[Any] | signedinteger[Any] | unsignedinteger[Any]]], area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_transform(source: CrsInput, target: CrsInput, x: FloatInput, y: FloatInput, z: FloatInput | None = None, *, t: FloatInput | None = None, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float] | tuple[float, float, float] | NDArray[float64]
Reproject raw coordinates from one CRS to another.
For geometries use to_crs; this is
the lower-level coordinate-column form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
CRS - like
|
Source and target CRS-like inputs. |
required |
target
|
CRS - like
|
Source and target CRS-like inputs. |
required |
x
|
float or sequence of float
|
Coordinate columns (scalars transform a single point). |
required |
y
|
float or sequence of float
|
Coordinate columns (scalars transform a single point). |
required |
z
|
float or sequence of float
|
Vertical column for 3D transforms. |
None
|
t
|
float or sequence of float
|
Coordinate epoch column. |
None
|
area_of_interest
|
sequence of float, dict, or object
|
Area of interest guiding operation selection, as
|
None
|
source_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
target_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
authority
|
str
|
Restrict candidate coordinate operations to this authority
(e.g. |
None
|
accuracy
|
float
|
Maximum acceptable operation accuracy, in meters. |
None
|
allow_ballpark
|
bool
|
Allow low-accuracy ballpark operations when no precise one exists. |
None
|
only_best
|
bool
|
Require PROJ's best operation. If a required transformation grid is
unavailable, raise |
None
|
force_over
|
bool
|
Keep coordinates on the source side of the antimeridian instead of
wrapping into |
False
|
Returns:
| Type | Description |
|---|---|
tuple or ndarray
|
Scalars in, scalars out: |
Raises:
| Type | Description |
|---|---|
CRSError
|
If |
TransformError
|
If the transform is undefined or fails to apply. |
InvalidGeometryError
|
If coordinate columns are non-finite or differ in length. |
GeometryError
|
If an epoch option is invalid. |
See Also
Geometry.to_crs : Reproject a geometry.
Examples:
>>> import gometry as gm
>>> import numpy as np
>>> np.round(np.asarray(gm.crs_transform(4326, 3857, -122.4, 37.8)), 1).tolist()
[-13625505.7, 4551210.9]
crs_transform_bounds
¶
Accepted call forms
crs_transform_bounds(source: CrsInput, target: CrsInput, bounds: tuple[float, float, float, float], *, densify: int = 21, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float, float, float]
crs_transform_bounds(source: CrsInput, target: CrsInput, bounds: tuple[float, float, float, float, float, float], *, densify: int = 21, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float, float, float, float, float]
crs_transform_bounds(source: CrsInput, target: CrsInput, bounds: NDArray[floating[Any]], *, densify: int = 21, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float, float, float] | tuple[float, float, float, float, float, float] | NDArray[float64]
crs_transform_bounds(source: CrsInput, target: CrsInput, bounds: Iterable[tuple[float, float, float, float]] | Iterable[tuple[float, float, float, float, float, float]], *, densify: int = 21, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> NDArray[float64]
crs_transform_bounds(source: CrsInput, target: CrsInput, bounds: Iterable[float], *, densify: int = 21, area_of_interest: CrsAreaInput | None = None, source_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, target_epoch: SupportsFloat | SupportsIndex | FloatScalar | ScalarFloatArray | None = None, authority: str | None = None, accuracy: float | None = None, allow_ballpark: bool | None = None, only_best: bool | None = None, force_over: bool = False) -> tuple[float, float, float, float] | tuple[float, float, float, float, float, float]
Reproject a bounding box, densifying edges for accuracy.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
CRS - like
|
Source and destination CRS-like inputs. |
required |
target
|
CRS - like
|
Source and destination CRS-like inputs. |
required |
bounds
|
sequence of float or iterable of sequences of float
|
A scalar box is a 4-value |
required |
densify
|
int
|
Points added per edge before transforming, to track curved edges.
Must be a non-boolean, nonnegative integer that fits in |
21
|
area_of_interest
|
sequence of float, dict, or object
|
Area of interest guiding operation selection, as
|
None
|
source_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
target_epoch
|
numeric scalar or 0-D numeric array
|
Coordinate epochs for dynamic CRS. |
None
|
authority
|
str
|
Restrict candidate coordinate operations to this authority
(e.g. |
None
|
accuracy
|
float
|
Maximum acceptable operation accuracy, in meters. |
None
|
allow_ballpark
|
bool
|
Allow low-accuracy ballpark operations when no precise one exists. |
None
|
only_best
|
bool
|
Require PROJ's best operation. If a required transformation grid is
unavailable, raise |
None
|
force_over
|
bool
|
Keep coordinates on the source side of the antimeridian instead of
wrapping into |
False
|
Returns:
| Type | Description |
|---|---|
tuple or ndarray
|
The reprojected box in the target CRS. Scalar input returns a 4- or
6-value tuple. Batch input returns a |
Raises:
| Type | Description |
|---|---|
TransformError
|
If no transform exists between the frames or it fails to apply. |
CRSError
|
If |
GeometryError
|
If a bounds box does not contain four or six finite values, a batch is
empty, batch rows have inconsistent dimensions, or |
TypeError
|
If |
OverflowError
|
If |
Examples:
>>> import gometry as gm
>>> import numpy as np
>>> np.round(np.asarray(gm.crs_transform_bounds(
... 4326, 3857, (-123, 37, -122, 38))), 0).tolist()
[-13692297.0, 4439107.0, -13580978.0, 4579426.0]
crs_unit
¶
crs_unit(authority: str, code: str) -> CrsUnitInfo
Detail record for a single unit of measure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Unit authority and code (e.g. |
required |
code
|
str
|
Unit authority and code (e.g. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
The unit-of-measure record (name, category, conversion factor). |
Examples:
>>> import gometry as gm
>>> gm.crs_unit('EPSG', '9001')['name']
'metre'
crs_units
¶
crs_units(authority: str, *, category: str | None = None, allow_deprecated: bool = False) -> list[CrsUnitInfo]
List the units of measure an authority defines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
authority
|
str
|
Unit authority (e.g. |
required |
category
|
str
|
Restrict to one unit category (e.g. |
None
|
allow_deprecated
|
bool
|
Whether deprecated units are included. |
False
|
Returns:
| Type | Description |
|---|---|
list
|
One record per matching unit of measure. |
Examples:
>>> import gometry as gm
>>> gm.crs_units('EPSG')[0]['name']
'(bin)'
crs_utm_zones
¶
crs_utm_zones(*, datum_name: str | None = None, area_of_interest: CrsAreaInput | None = None, contains_area_of_interest: bool = False, allow_deprecated: bool = False) -> list[CrsCatalogInfo]
UTM-zone CRS from the catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datum_name
|
str
|
Restrict to projected CRSs whose displayed name starts with this datum
prefix followed by |
None
|
area_of_interest
|
sequence of float, dict, or object
|
Filter area as |
None
|
contains_area_of_interest
|
bool
|
Require the zone area to contain |
False
|
allow_deprecated
|
bool
|
Include deprecated zones (default |
False
|
Returns:
| Type | Description |
|---|---|
list of CrsCatalogInfo
|
|
Examples:
>>> import gometry as gm
>>> gm.crs_utm_zones()[0]['code']
'10286'