Repository navigation
Story: Support CircularString in WKT and EWKT decoding #42
Description
Support CircularString in WKT and EWKT decoding
As a user of the spatial decoder,
I want WKT and EWKT representations of CIRCULARSTRING to be decoded,
so that circular curves can be reconstructed as their corresponding spatial objects without losing their geometry semantics.
Context
spatial-types provides a concrete implementation of CIRCULARSTRING.
The WKT and EWKT decoder strategies must be able to construct this spatial type from valid textual representations.
WKT and EWKT share the common textual parsing infrastructure, while each strategy remains responsible for its own dialect rules. In particular, WKT must continue to reject SRID syntax, whereas EWKT may use its supported SRID syntax.
A CIRCULARSTRING is composed of circular arc segments represented by control points. The decoder must preserve those points and must not linearize or approximate the curve.
Acceptance Criteria
- The shared textual decoding infrastructure recognizes
CIRCULARSTRINGas a geometry type. - The WKT strategy decodes valid
CIRCULARSTRINGgeometries. - The EWKT strategy decodes valid
CIRCULARSTRINGgeometries. - A decoded geometry is returned as the corresponding
CircularStringInterfacespatial object. -
CIRCULARSTRING EMPTYis decoded according to thespatial-typesempty geometry contract. - A non-empty
CIRCULARSTRINGpreserves the complete ordered sequence of control points. - A single circular arc represented by three control points is decoded correctly.
- A
CIRCULARSTRINGcontaining multiple connected circular arcs is decoded correctly. - A closed
CIRCULARSTRINGwhose first and last points coincide is preserved as closed. - A valid collinear three-point arc is not rejected solely because its control points are collinear.
- XY coordinates are supported.
- XYZ coordinates are supported.
- XYM coordinates are supported.
- XYZM coordinates are supported.
- Coordinate dimension markers are interpreted according to the applicable WKT or EWKT grammar.
- The coordinate dimension of the resulting spatial object matches the decoded representation.
- EWKT preserves the decoded SRID in the resulting spatial object.
- WKT continues to reject SRID syntax.
- Invalid
CIRCULARSTRINGrepresentations fail through the decoder's defined exception contract. - Invalid control-point counts are rejected according to the
CIRCULARSTRINGspatial contract. - Inconsistent coordinate dimensions are rejected.
- The decoder does not convert, approximate, or linearize the circular curve.
- Existing WKT and EWKT decoding behavior for previously supported geometry types remains unchanged.
- Automated tests cover EMPTY, single-arc, multiple-arc, closed and collinear cases.
- Automated tests cover XY, XYZ, XYM, and XYZM representations.
- Automated tests cover valid EWKT SRID handling and WKT SRID rejection.
- Automated tests cover representative invalid
CIRCULARSTRINGrepresentations.
Responsibility boundary
The decoder is responsible for:
- recognizing the WKT and EWKT syntax;
- extracting the geometry type, dimension, coordinates, and EWKT spatial reference information;
- constructing the corresponding
spatial-typesobject; - reporting syntax and decoding errors through the decoder exception contract.
Structural and geometric invariants already guaranteed by spatial-types should not be independently reimplemented by the decoder unless they are required to recognize invalid syntax.
Dependencies
CIRCULARSTRINGmust be available inspatial-types.- The common curve contract required by
CIRCULARSTRINGmust be available. - The shared WKT/EWKT lexer and parser infrastructure must recognize the required geometry type and dimension tokens.
Out of scope
COMPOUNDCURVE.- Other curved geometry types.
- WKB or EWKB decoding.
- GeoJSON decoding.
- MySQL binary decoding.
- Curve linearization or approximation.
- Changes to the
CIRCULARSTRINGspatial contract.
Activity
[-]Support CircularString in WKT and EWKT decoding[/-][+]Story: Support CircularString in WKT and EWKT decoding[/+]Alexandre-T commentedon Oct 5, 2026
API Gate — Approved
I approve the API impact of adding WKT and EWKT decoding support for CIRCULARSTRING in this Story.
For valid CIRCULARSTRING input, the decoder may return the corresponding CircularStringInterface spatial object, preserving its coordinate dimension, ordered control points, and EWKT SRID where applicable. Existing WKT/EWKT behavior for previously supported geometry types, including WKT rejection of SRID syntax, must remain unchanged.
This approval is limited to the API impact described in this Story. It does not authorize unrelated API changes or breaking changes.