odc.geo.crs.crs_units_per_degree

odc.geo.crs.crs_units_per_degree(crs, lon, lat=0, step=0.1)[source]

Helper method for converting resolution between meters/degrees.

Compute number of CRS units per degree for a projected CRS at a given location in lon/lat.

Location can be supplied as a tuple or as two arguments.

Parameters:
  • crs (Union[str, int, CRS, CRS, Dict[str, Any]]) – CRS

  • lon (Union[float, Tuple[float, float]]) – Either longitude or (lon, lat) tuple

  • lat (float) – Latitude or ignored if lon was a tuple

  • step (float) – Length of the segment in degrees used to estimate relative scale change

Return type:

float

Returns:

A floating number S such that S*degrees -> meters