geoarrow / geoarrow-r

Extension types for geospatial data for use with 'Arrow'
http://geoarrow.org/geoarrow-r/
Apache License 2.0
148 stars 6 forks source link

WKB with non-2D dimensions doesn't follow ISO encoding #5

Closed rouault closed 2 years ago

rouault commented 2 years ago

I noticed that WKB geometry with xyz, xym or xyzm coordinate dimension use the 30th and 31th most-significant bits of the int32 flag at offset 1 of the WKB instead of the 2D_code+1000, 2D_code+2000, 2D_code+3000 used by ISO WKB.

paleolimbot commented 2 years ago

Definitely not on purpose...thanks! Today (hopefully) geoarrow is getting its own Arrow-native WKB encoder and I'll make sure it does proper ISO output.

rouault commented 2 years ago

Not sure if you're aware of it, but there are GeoParquet & GeoArrow OGR drivers sitting at https://github.com/OSGeo/gdal/pull/5477 if you want to do some interoperability checks. I noticed that a bit by chance because the drivers just use OGR WKB import that happily ingests that non-ISO WKB as it is the same as the PostGIS EWKB (without the SRID flag)

paleolimbot commented 2 years ago

Yes, it's very exciting! I can and will check to make sure the arrays generated can be read (and that geoarrow can read the OGR-generated arrays)...right now I'm rewriting pretty much all of it to use the C Data interface and live in mostly header-only C++ (so that it can get reused in Python and maybe elsewhere if it's good enough), which will probably take another week or so to do properly.