[FEAT] Add simple-features geometry type and initial operations #3061
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After discussion with @desmondcheongzx in #3017, I thought it might be worthwhile to open a PR for this work I've done making a (e)wkb backed geometry type representing "simple-features" geometries. Basically it implements a logical Geometry type whose physical backing is the validated (e)wkb bytes. This method incurs cost in serde upon operations, but enables earlier and potentially wider support for geo operations (due to existing library support) and supports collections and non-uniform geometries - so should have use before and even after native types would be added.
Here are included encoding/decoding (wkt/wkb) and a number of operations within the "geo" expression namespace to demonstrate combinations of unary/binary to bool/float/geometry, but is not meant to be in any way complete.
There are more examples in the discussion linked above, but very briefly what it looks like:
There are probably a number of missing/wrong things in here, and some organizational improvements that could be made (daft-geo crate?), and docs - but may be a start 😄