---
id: polygon_bbox_py_geo
name: polygon_bbox
kind: function
lang: py
domain: geo
version: "1.0.0"
purity: pure
signature: "polygon_bbox(polygon: list[list[tuple[float, float]]]) -> tuple[float, float, float, float]"
description: "Calcula el bounding box (minx, miny, maxx, maxy) que envuelve todos los anillos de un poligono."
tags: [geo, polygon, bbox, bounds]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: []
example: |
  from geo.polygon_bbox import polygon_bbox
  ring = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
  bbox = polygon_bbox([ring])  # (0.0, 0.0, 1.0, 1.0)
tested: true
tests: ["cuadrado_unitario", "poligono_con_hole"]
test_file_path: "python/functions/geo/tests/test_polygon_bbox.py"
file_path: "python/functions/geo/polygon_bbox.py"
params:
  - {name: polygon, desc: "lista de anillos [(lon, lat)]; puede incluir anillo exterior y agujeros"}
output: "tupla (minx, miny, maxx, maxy) con las coordenadas extremas del poligono"
source_repo: "internal:footprint_aurgi"
source_license: "internal-aurgi"
source_file: "zonas_mapas_aurgi/backend/app.py:709"
---

## Ejemplo

```python
from geo.polygon_bbox import polygon_bbox

ring = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
polygon_bbox([ring])  # (0.0, 0.0, 1.0, 1.0)
```

## Notas

Recorre todos los anillos (exterior + holes) para calcular el bbox global.
