Answer the extended WKB of a geometry as the buffer it is - #40
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Conversation
The catalog states `size` as the parameter MEOS writes the length of `geo_as_ewkb`'s buffer into, so the method reads it: `AsEWKB(string endian)` answers a `byte[]` exactly as long as the data, joining the twenty-eight other buffers the layer already folds that way. The length is the whole of it — an extended WKB buffer carries no terminator and no length of its own, so a caller holding the pointer without it has no way to say where the geometry ends. The layer emits 1353 methods over 115 classes with 7 deferred. Its own test reads the hex form of the same geometry as an independent statement of the same length: `AsHexewkb` answers a string of exactly twice as many characters, and hex-encoding the buffer reproduces it character for character, so a buffer of the wrong length fails on the count before it fails on the content. The second test round-trips the bytes back through `FromEWKB` to the value they came from.
estebanzimanyi
deleted the
feat/the-ewkb-buffer-states-its-own-length
branch
September 3, 2026 16:07
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.
The catalog states
sizeas the parameter MEOS writes the length ofgeo_as_ewkb's buffer into, so the method reads it:AsEWKB(string endian)answers a
byte[]exactly as long as the data, joining the twenty-eight otherbuffers the layer already folds that way. The length is the whole of it — an
extended WKB buffer carries no terminator and no length of its own, so a caller
holding the pointer without it has no way to say where the geometry ends.
The layer emits 1353 methods over 115 classes with 7 deferred. Its own test
reads the hex form of the same geometry as an independent statement of the same
length:
AsHexewkbanswers a string of exactly twice as many characters, andhex-encoding the buffer reproduces it character for character, so a buffer of
the wrong length fails on the count before it fails on the content. The second
test round-trips the bytes back through
FromEWKBto the value they came from.