--- name: load_boundary_gdf kind: function lang: py domain: geo version: "1.0.0" purity: impure signature: "def load_boundary_gdf(path: str | Path, crs: str = 'EPSG:4326') -> GeoDataFrame" description: "Lee un GeoJSON con geopandas y normaliza el CRS. Si el archivo no tiene CRS lo asigna; si ya tiene CRS lo reproyecta al solicitado." tags: [geo, geojson, geopandas, crs, boundary, io, pendiente-usar] uses_functions: [] uses_types: [] returns: [] returns_optional: false error_type: "error_go_core" imports: ["geopandas", "pathlib"] params: - name: path desc: "Ruta al archivo GeoJSON." - name: crs desc: "CRS destino en formato EPSG. Default EPSG:4326 (WGS84)." output: "GeoDataFrame con el CRS solicitado. Cada fila es una feature del GeoJSON." tested: true tests: - "retorna GeoDataFrame con CRS EPSG:4326" - "archivo inexistente lanza FileNotFoundError" test_file_path: "python/functions/geo/tests/test_load_boundary_gdf.py" file_path: "python/functions/geo/load_boundary_gdf.py" source_repo: "internal:footprint_aurgi" source_license: "internal-aurgi" source_file: "ponderacion_isochronas/src/recomendador_centros.py:199" --- ## Ejemplo ```python from geo.load_boundary_gdf import load_boundary_gdf gdf = load_boundary_gdf("boundary.geojson", crs="EPSG:4326") print(gdf.crs) # EPSG:4326 print(gdf.shape) # (n_features, n_columns) ``` ## Notas Requiere geopandas. Si el archivo ya tiene CRS se llama `to_crs`; si no tiene CRS se llama `set_crs` para evitar advertencias de geopandas. Lanza FileNotFoundError antes de llamar a geopandas si el archivo no existe.