environmentaltools.download.calculate_extent

environmentaltools.download.calculate_extent(lon: float, lat: float, distance_x: float, distance_y: float) list[float][source]

Calculate the geographic extent (bounding box) for a map centered at a location.

This function uses geodesic calculations to determine the map extent based on the center point and distances from the center to the edges.

Parameters:
  • lon – Longitude of the center point in degrees.

  • lat – Latitude of the center point in degrees.

  • distance_x – Distance from center to edge in the x-direction (meters).

  • distance_y – Distance from center to edge in the y-direction (meters).

Returns:

A list of four floats [lon_min, lon_max, lat_min, lat_max] representing the bounding box extent in degrees.

Notes

Uses cartopy’s Geodesic class to accurately calculate positions on the Earth’s surface, accounting for the Earth’s curvature.