geoarrow-rs icon indicating copy to clipboard operation
geoarrow-rs copied to clipboard

POC: Allow binary view/string view arrays in `from_wkb`/`from_wkt`

Open kylebarron opened this issue 8 months ago • 2 comments

It's not a big change so we should probably do it. I'm sure there will be cases in e.g. DataFusion where it automatically parses strings as Utf8View and we'll want to parse them.

Closes https://github.com/geoarrow/geoarrow-rs/issues/942

kylebarron avatar Apr 20 '25 04:04 kylebarron

where it automatically parses strings as Utf8View and we'll want to parse them.

I think the default read for Parquet does this!

paleolimbot avatar Apr 20 '25 05:04 paleolimbot

Note that here it would be ideal if we implemented our own BinaryArrayType trait, because then we could implement it both on upstream types like BinaryArray and our own types like WkbArray.

We can't implement the upstream BinaryArrayType trait on our WkbArray because we'd have to implement Array for WkbArray. But that doesn't work because downcasting using as_any would fail, because our LineStringArray is not actually a ListArray. Implementing Array for our array types would make it too easy to confused whether something is actually an arrow type or a geometry array masquerading as an arrow array.

kylebarron avatar Apr 20 '25 22:04 kylebarron