Skip to main content

Module spatial

Module spatial 

Source

Structs§

LoraPoint
A 2D or 3D point, either Cartesian or WGS-84 Geographic.

Enums§

PointKeyFamily
Which coordinate family the caller used.

Constants§

CRS_CARTESIAN
Canonical CRS name strings as understood by point().
CRS_CARTESIAN_3D
CRS_WGS84_2D
CRS_WGS84_3D
SRID_CARTESIAN
SRID_CARTESIAN_3D
SRID_WGS84
SRID_WGS84_3D

Functions§

cartesian_distance
Euclidean distance between two Cartesian points (2D or 3D).
haversine_distance
Haversine distance in metres between two WGS-84 geographic points.
point_distance
Distance between two points — dispatches to Euclidean or Haversine depending on SRID. Returns None if the SRIDs don’t match, which also covers the 2D-vs-3D mismatch since the dimension is baked into the SRID (7203 vs 9157, 4326 vs 4979).
resolve_srid
Resolve a final SRID from the optional user-provided crs, srid, plus the detected key family and dimensionality.
srid_from_crs_name
Normalise a CRS name string to its canonical SRID.
srid_is_3d
srid_is_geographic
srid_is_supported
Recognise a bare SRID as one of the four supported values.