Repository navigation
Support extended geometry types in WKB, WKT and TWKB - #405
Merged
Merged
Conversation
This was referenced Oct 28, 2026
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.
Summary
Closes #404.
Adds WKB, WKT and TWKB support for the extended geometry types that PostGIS can emit, using the lossy mappings agreed in the issue:
CircularStringLineStringCompoundCurveLineStringCurvePolygonPolygonMultiCurveMultiLineStringMultiSurfaceMultiPolygonTINMultiPolygonPolyhedralSurfaceMultiPolygonPOINT EMPTYMultiPointCircular arcs are sampled with 32 segments per quadrant by a new internal
CurveLinearizationhelper. Linearization happens in the source projection before reprojection, andZ/Mvalues are interpolated along the arc.WKB
+1000Z,+2000M,+3000ZM) used by PostGIS alongside EWKB dimension flags.CircularString,CompoundCurve,CurvePolygon,MultiCurveandMultiSurfacelinearize into the existing model types.TINandPolyhedralSurfacedecode toMultiPolygon; triangle patches reuse the existing type-17 decoder.POINT EMPTY(NaN coordinates) decodes to an emptyMultiPointinstead of failing.WKT
CIRCULARSTRING,COMPOUNDCURVE,CURVEPOLYGON,MULTICURVE,MULTISURFACE,TINandPOLYHEDRALSURFACE, including nested dimension suffixes such asMULTISURFACE Z (CURVEPOLYGON Z (...)).EMPTYfor every geometry type, and empty geometries now encode asTYPE EMPTYinstead ofTYPE().POINT EMPTYdecodes to an emptyMultiPoint.TWKB
POINT EMPTYbecomes an emptyMultiPoint).TINas aGeometryCollectionin TWKB, so it decodes as a collection. TWKB has no curve orPolyhedralSurfacetype code; unsupported types now fail explicitly.Verification
--traits EnableGraphAPI.Behavior changes
POINT EMPTYno longer throws in WKB/WKT; it decodes as an emptyMultiPoint.EMPTYkeyword rather than empty parentheses.