itacart.interop.from_geodataframe
- itacart.interop.from_geodataframe(gdf, resolution, containment='center')[source]
Fill every geometry of a GeoDataFrame into a compositional index.
Requires the
geoextra. This is a thin adapter: it reprojects to EPSG:4326 and delegates tofrom_geojson(), so the filling logic exists in exactly one place, and that place is the path that needs no optional extra and is therefore testable in any environment.- Parameters:
gdf (
GeoDataFrame) – Input frame in any CRS; reprojected to EPSG:4326 as needed.resolution (
int) – Target resolution level, 1 to 13.containment (
str, default:"center") – Predicate passed through toitacart.geometry.polyfill().
- Return type:
- Returns:
One compositional index per row, in row order, as
from_geojson()answers it, the known limitation of a point inside the cell that holds a pole at resolution 10 included.- Raises:
ImportError – If GeoPandas is not installed.
GeometryError – As
from_geojson()raises it, the refusal of a geometry that reaches the cell that holds a pole at resolution 10 included.