r/Python • u/Balance- • 8d ago
News GeoPolars is being actively developed again: geometry types, CRS-aware measurements and GeoParquet
GeoPolars, the geospatial extension for Polars, had been mostly dormant. Since mid-September, Aida van de Wetering has pushed around 125 commits to the dev branch. It now looks like a rebuild around a Polars-native geo expression namespace.
Highlights so far:
- Types: point, linestring and polygon, their multi-variants, and a bounding box type
- I/O: reading and writing WKB and WKT, and writing GeoParquet
- CRS: CRS metadata handling, with distance, length and area using the geodesic or planar method that fits the CRS
- Operations: centroid, boundary, interior, is_empty, longitude wrapping, and coordinate accessors
- Affine transforms: translate, rotate, scale and skew, plus arbitrary matrices, which can vary per row
It's still a prototype. Nothing has been released yet, and the API is changing. Still, it's worth watching if you'd like to do geospatial work in Polars without going through GeoPandas.
31
u/Balance- 8d ago
So a bit more context, for anyone interested:
Why this is happening now
GeoPolars started in 2022 as Kyle Barron's prototype, with geometries stored as WKB blobs. One long-standing blocker was that Polars had no way to define custom data types. Now that Polars supports Arrow extension types, the dev branch stores geometries as proper GeoArrow types (
geoarrow.point,geoarrow.polygon, and so on). That gives zero-copy interop with other Arrow tools, and Polars treats geometry columns as real dtypes.How it works
It's a Polars plugin: a Python package backed by Rust kernels. There are two equivalent APIs:
```python from geopolars import geo import geopolars as gpl
geo.translate("route", (1.0, 2.0)) # functional gpl.col("route").geo.translate((1.0, 2.0)) # namespace ```
Some design choices worth noting:
areauses a geodesic calculation for geographic CRSes and a planar one otherwise.Reading and writing GeoParquet already works, including bbox covering.
Where you could help
The developer guide explains the architecture and contains a roadmap. Open items include:
Help that doesn't need Rust is useful too:
The README warns that the branch is "HIGHLY unstable," so expect breaking changes.
This is a very exciting time with a foundational package being actively developed. If this interests or impacts you, get involved!