Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support geometries with Z and M values #280

Merged
merged 26 commits into from
Mar 13, 2024
Merged

Support geometries with Z and M values #280

merged 26 commits into from
Mar 13, 2024

Conversation

Maxxen
Copy link
Member

@Maxxen Maxxen commented Mar 12, 2024

This PR includes a major rework of the runtime geometry representation to enable support for Z and M values. Although no functions that specifically make use of the Z or M axis are implemented yet, and some existing functions may have limited support. Im not terribly happy with the vertex array abstraction yet but it works. Additionally:

There is a new GeometryProcessor abstraction which is used to unify deserialization to GEOS geometries and DuckDB native geometries while also enabling some operations to be performed while deserializing, "zero-copy"-style so as to avoid materializing the geometry hierarchy entirely. The only functions to make use of this so far is ST_Area, ST_AsWKB, ST_(Min/Max)/X/Y/Z/M and ST_AsText.

We now use our own WKT parser instead of relying on GEOS. I don't expect it to be more efficient but it does allow us to handle empty Z and M geometries and provide better error messages (eventually, they're not that exact yet).

New ST_Force2D, ST_Force3DZ, ST_Force3DM and ST_Force4DM functions have been added.

@kylebarron
Copy link

Does this support Z and M in the native representations as well or just in the GEOS one?

@Maxxen
Copy link
Member Author

Maxxen commented Mar 12, 2024

Native too! + WKB/GeoJSON/GDAL support. Although I haven't added new vectorized representations like POLYGON_2D

@kylebarron
Copy link

Although I haven't added new vectorized representations like POLYGON_2D

ah that was what I meant to ask!

@Maxxen Maxxen merged commit 592bda4 into duckdb:v0.10.0 Mar 13, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants