from_deg_to_meters

from_deg_to_meters#

from_deg_to_meters(deg: float, lat: float | None = None, decimals: float = 2, average_lat_lon: bool = False) float[source]#

Approximately convert a distance in degrees to a distance in meters.

Only true at the Equator if lat is not given. Very false for longitude distance elsewhere.

If lat is given

See https://wiki.openstreetmap.org/wiki/Precision_of_coordinates

Parameters:
  • deg (float) – Distance in degrees

  • lat (float) – Latitude (useful if the distance is longitudinal)

  • decimals (float) – To round the distance, as the precision can be poor here

  • average_lat_lon (bool) – Average between lat distance and lon distance

Returns:

Distance in meters

Return type:

float