Expose APIs for accessing the underlying WKB buffer to implement various functions efficiently#85
Merged
kylebarron merged 2 commits intogeorust:mainfrom Sep 30, 2025
Conversation
86b7a80 to
7d2af93
Compare
kylebarron
reviewed
Sep 29, 2025
| impl<'a> GeometryCollection<'a> { | ||
| /// Construct a new GeometryCollection from a WKB buffer. | ||
| /// | ||
| /// This will parse the WKB header and extract all contained geometries. |
Member
There was a problem hiding this comment.
On the contrary, I planned to make all of these constructors pub(crate) #75
I don't think these constructors are currently publicly accessible (since these modules aren't public), so I don't think it should be a breaking change.
Is there any reason why you would want these constructors to be public?
Contributor
Author
There was a problem hiding this comment.
I don't need these constructors to be public, the comments added to these methods were just for passing the missing_docs check.
I'll submit another commit to mark these fn try_new constructors pub(crate) and also remove unused fn new constructors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CHANGES.mdif knowledge of this change could be valuable to users.This work originates from SedonaDB. We have implemented a fast WKB to GEOS geometry conversion function in our own fork of wkb: wherobots#2, which requires access to the underlying WKB buffer and structs defined for individual geometry types. Having access to these implementation details allows us to make this particular task 4 times faster.
I believe that there might be other scenarios where having access to the raw WKB buffer will help a lot, so I added several methods for exposing slices of WKB buffers and some metadata about the encoded coordinates.