crs¶
Metric-CRS checks.
quakecascade.crs
¶
Metric coordinate reference system checks.
Every distance in the package is computed in a projected CRS with metre units. Callers state the CRS; when they pass geographic coordinates the library can estimate the local UTM zone, but it never measures in degrees.
CRSError
¶
Bases: ValueError
Raised when an operation needs metric coordinates and does not get them.
require_metric
¶
Return crs as a pyproj.CRS if it can measure metres, else raise CRSError.
The CRS must be projected with metre units, and not a (pseudo-)Mercator
projection such as EPSG:3857 or EPSG:3395, whose distances are inflated by
1 / cos(latitude) (about +28 % at 38 degrees north). what names
the caller in the error message.
estimate_utm_crs
¶
WGS 84 / UTM zone covering the median of lon/lat (degrees).
ensure_metric_frame
¶
Return gdf unchanged if metric, else raise. GeoDataFrames only.