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 geo extra. This is a thin adapter: it reprojects to EPSG:4326 and delegates to from_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 to itacart.geometry.polyfill().

Return type:

list[str]

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: