Skip to content

geoparquet

V0.4.1 Updates

Highlights

  • All geometry WKB will be stored in the df as little endian ISO / Properly handling input wkb with SRID added to it 🐛
  • No longer renaming your geometry column "geometry" without your permission 🚫
  • scan_spatial will no longer work with geoparquet 😢
  • scan_geoparquet added to do that! 😄 🎉

Little Endian ISO WKB

In V0.4.0 new functionality was added to user polars expressions to parse geometry WKB and performa operations without converting to shapely first. This worked, but parsing different flavors/byte orders looked like it was going to be a lot more work and less efficient than only dealing with one flavor/byte order. Now when the WKB is added to the struct, if it is not already little endian/ISO it will be automatically transformed to it with shapley. This will also handle a bug I had when working with coordinates of extended WKB points with an embedded SRID.

No more automagically changing names of gometry columns to "geometry"

Not all geospatial sources call their geometry field "geometry". Spatial polars shouldn't have renamed the column if the data had a different name for the field. It no longer does that.

Scan spatial/Scan geoparquet

When Spatial polars started, polars did not like to read parquet files that had extensions on columns. To work around that, spatial polars used to read the batches of geoparquet data with pyarrow and then convert that to a polars series in the scan_spatial function. Polars can now handle reading in geoparquet files without issue, that said, the geoparquet metadata with the CRS of the data is lost when you read a geoparqut file with polars. I've added a new scan_geoparquet function to spatial polars that will call polars' scan_parquet but also finds all(1) the geometry columns and converts them to the spatial polars geometry struct using the crs from the geoparquet file's column metadata.

  1. The old scan_spatial function only converted the column that the metadata designated as the primary column