Skip to content

Story: Support CircularString in WKT and EWKT decoding #42

Closed

Description

@Alexandre-T

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 CIRCULARSTRING as a geometry type.
  • The WKT strategy decodes valid CIRCULARSTRING geometries.
  • The EWKT strategy decodes valid CIRCULARSTRING geometries.
  • A decoded geometry is returned as the corresponding CircularStringInterface spatial object.
  • CIRCULARSTRING EMPTY is decoded according to the spatial-types empty geometry contract.
  • A non-empty CIRCULARSTRING preserves the complete ordered sequence of control points.
  • A single circular arc represented by three control points is decoded correctly.
  • A CIRCULARSTRING containing multiple connected circular arcs is decoded correctly.
  • A closed CIRCULARSTRING whose 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 CIRCULARSTRING representations fail through the decoder's defined exception contract.
  • Invalid control-point counts are rejected according to the CIRCULARSTRING spatial 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 CIRCULARSTRING representations.

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-types object;
  • 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

  • CIRCULARSTRING must be available in spatial-types.
  • The common curve contract required by CIRCULARSTRING must 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 CIRCULARSTRING spatial contract.

Activity

  1. added theissue type on Oct 4, 2026
  2. added
    spatial:wktRelated to Well-Known Text or Extended Well-Known Text
    standard:isoRelated to ISO spatial standards
    on Oct 4, 2026
  3. changed the title [-]Support CircularString in WKT and EWKT decoding[/-] [+]Story: Support CircularString in WKT and EWKT decoding[/+] on Oct 5, 2026
  4. Alexandre-T commented on Oct 5, 2026

    @Alexandre-T
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact:apiAffects the public APIspatial:geometryRelated to geometry models or typesspatial:wktRelated to Well-Known Text or Extended Well-Known Textstandard:isoRelated to ISO spatial standards

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions