pysepal.mapping.bounds#

Auxiliary functions for computing map bounds and zoom levels.

Functions

compute_center

Given [[south, west], [north, east]], return (lat, lon) center.

compute_zoom_for_bounds

Calculate the Web Mercator zoom that fits bounds into the viewport.

viewport_pixels_from_map

Derive the map viewport (width, height) in pixels from synced bounds+zoom.

viewport_width_from_map

Back-compat wrapper returning only the viewport width in pixels.