_duckdb-geography - Global vector data in DuckDB_ was a talk by [[Dewey Dunnington]] for [[GeoPython 2025]] where he introduced the `duckdb-geography` package, which introduces [[Geography data type]] support for [[DuckDB]].
You can install `duckdb-geopgraphy` on a [[DuckDB]] connection in [[Python]] using `conn.install_extension("geography", repository="community")`, in order to use a geography type in it.
He showed a comparison with [[Spherely]], where the order is kept and has in-memory data structures. On the other hand `duckdb-geography` has automatic parallelization because everything is serialized.
It includes an [[S2]] cell data type, that allows traversing the hierarchy.
- An [[S2]] cell is represented by an `uint64` and [[S2 cell containment can be calculated using a simple comparison]].
- You can simply cast to geography to get the actual polygon.
- It also allows for `s2_covering()` which provides a cell union that approximates coverage of a more complex shape.
`duckdb-geometry` can also load and perform partitioning on a dataset that is larger than memory and store it in a [[GeoParquet]] file, for example.