Skip to content

Story: Complete EWKT geometry coverage and compatibility validation #35

Closed

Description

@Alexandre-T

Complete EWKT geometry coverage and compatibility validation

As a user of the spatial decoder,
I want supported spatial geometries and EWKT edge cases to be handled
consistently,
so that valid EWKT input produces the expected spatial objects while
unsupported or invalid input is reported accurately.

Context

The EWKT strategy supports PostGIS spatial reference information and
dimensional representations.

The strategy must provide consistent decoding across all geometry types that
can currently be represented by spatial-types, including empty geometries
and nested geometry structures.

PostGIS also recognizes spatial types that may not yet be represented by
spatial-types. When such a type is recognized as valid EWKT but cannot be
instantiated, the decoder must distinguish this implementation limitation from
invalid input by using NotYetImplementedException.

The decoder should remain permissive toward unambiguous EWKT representations,
while preserving the geometry structure, dimensionality, coordinates, and
SRID represented by the input.

Acceptance Criteria

  • Every EWKT geometry type that can currently be represented by
    spatial-types can be decoded by the EWKT strategy.
  • Supported EMPTY geometries are decoded while preserving their geometry
    type, dimensionality, and SRID.
  • Supported multi-geometries and geometry collections are decoded with
    their complete nested structure preserved.
  • Triangle and PolyhedralSurface EWKT representations are decoded when
    they can be represented by the corresponding spatial-types objects.
  • Geometry components are validated for structural and dimensional
    consistency before the resulting spatial object is returned.
  • The SRID defined by the root EWKT geometry is consistently applied to
    the resulting spatial structure.
  • Nested geometries cannot introduce an independent SRID.
  • A spatial type recognized as valid by the supported EWKT grammar but not
    yet representable by spatial-types causes a
    NotYetImplementedException.
  • The NotYetImplementedException identifies the recognized spatial type
    that cannot yet be instantiated.
  • Unknown spatial types, malformed EWKT, invalid geometry structures, and
    recognized but not yet implemented spatial types remain distinguishable
    through the decoder exception model.
  • Existing WKT decoding behavior remains unchanged.
  • Automated tests cover supported geometry families, EMPTY geometries,
    nested structures, invalid structures, and recognized spatial types that
    are not yet implemented.

References

  • PostGIS ST_GeomFromEWKT documentation.
  • PostGIS liblwgeom EWKT lexer and parser.
  • OGC Simple Feature Access for the underlying geometry model and standard WKT
    representations.
  • ISO/IEC 13249-3 for spatial geometry types, dimensional semantics, and WKT
    representations where applicable.

Activity

  1. Alexandre-T commented on Sep 30, 2026

    @Alexandre-T
    ContributorAuthor

    Definition of Ready — geometry type coverage

    This Story should not be considered Ready until the boundary between supported
    and recognized-but-not-yet-implemented spatial types is explicitly defined.

    Before implementation, establish an inventory of the spatial types recognized
    by the supported EWKT grammar and classify each type as:

    • currently representable by spatial-types and therefore required to decode
      successfully;
    • recognized as valid EWKT but not yet representable by spatial-types, and
      therefore required to raise NotYetImplementedException;
    • outside the EWKT grammar supported by the decoder.

    This inventory will remove implementation ambiguity and provide the baseline
    for future Epics introducing the missing spatial types across the LongitudeOne
    libraries.

  2. Alexandre-T commented on Oct 1, 2026

    @Alexandre-T
    ContributorAuthor

    As a user of the spatial decoder,
    I want the EWKT strategy to decode supported geometry types,
    so that EWKT values can be converted into the corresponding SpatialInterface objects while unsupported or non-instantiable types are handled explicitly.

    Context

    The EWKT lexer and parser recognize the geometry types defined by GeometryTypeEnum.

    However, not every geometry type represented by GeometryTypeEnum currently has a concrete implementation in spatial-types.

    The decoder must therefore distinguish between:

    • instantiable geometry types currently implemented by spatial-types;
    • instantiable geometry types recognized by the grammar but not yet implemented by spatial-types;
    • non-instantiable geometry types.

    This distinction must be explicit and deterministic.

    Supported geometry types

    The EWKT strategy decodes the following geometry types into their corresponding SpatialInterface implementations:

    • POINT
    • LINESTRING
    • POLYGON
    • TRIANGLE
    • POLYHEDRALSURFACE
    • MULTIPOINT
    • MULTILINESTRING
    • MULTIPOLYGON
    • GEOMETRYCOLLECTION

    The resulting object must preserve the spatial family, coordinate dimension and SRID determined from the EWKT input.

    POLYHEDRALSURFACE is implemented by spatial-types only for coordinate layouts containing Z. Unsupported coordinate layouts for an otherwise implemented geometry type are validation errors and must not be reported as an unimplemented geometry type.

    Recognized but not yet implemented geometry types

    The following geometry types are instantiable according to GeometryTypeEnum, but do not currently have a concrete implementation in spatial-types:

    • CIRCULARSTRING
    • COMPOUNDCURVE
    • CURVEPOLYGON
    • MULTICURVE
    • MULTISURFACE
    • TIN

    When one of these geometry types is encountered, the EWKT strategy must throw NotYetImplementedException.

    The exception must identify the geometry type that cannot currently be decoded.

    Non-instantiable geometry types

    The following GeometryTypeEnum values are explicitly non-instantiable:

    • GEOMETRY
    • CURVE
    • SURFACE
    • SOLID

    These types must not be treated as geometry types awaiting implementation.

    When one of these types is encountered where a concrete geometry is required, decoding must fail with the decoder error appropriate for a non-instantiable geometry type and must not throw NotYetImplementedException.

    Acceptance Criteria

    • POINT EWKT values are decoded into the corresponding point implementation.
    • LINESTRING EWKT values are decoded into the corresponding line string implementation.
    • POLYGON EWKT values are decoded into the corresponding polygon implementation.
    • TRIANGLE EWKT values are decoded into the corresponding triangle implementation.
    • POLYHEDRALSURFACE EWKT values are decoded when their coordinate layout is supported by spatial-types.
    • MULTIPOINT EWKT values are decoded into the corresponding multi-point implementation.
    • MULTILINESTRING EWKT values are decoded into the corresponding multi-line string implementation.
    • MULTIPOLYGON EWKT values are decoded into the corresponding multi-polygon implementation.
    • GEOMETRYCOLLECTION EWKT values are decoded into the corresponding collection implementation.
    • Decoded objects preserve the spatial family determined by the strategy.
    • Decoded objects preserve the coordinate dimension declared or inferred from the EWKT value.
    • Decoded objects preserve the EWKT SRID.
    • CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, MULTICURVE, MULTISURFACE and TIN are recognized and throw NotYetImplementedException.
    • NotYetImplementedException identifies the recognized geometry type that is not currently implemented.
    • GEOMETRY, CURVE, SURFACE and SOLID are rejected as non-instantiable geometry types and do not throw NotYetImplementedException.
    • An unsupported coordinate layout for an implemented geometry type is not reported as an unimplemented geometry type.
    • Empty geometries are decoded according to the capabilities of the corresponding spatial-types implementation.
    • Nested GEOMETRYCOLLECTION members are decoded recursively according to the same supported, unimplemented and non-instantiable type rules.
    • Automated tests cover every supported geometry type.
    • Automated tests cover every recognized but not yet implemented geometry type.
    • Automated tests cover the non-instantiable geometry-type rejection path.
    • Existing WKT decoding behavior remains unchanged.
    • The complete test suite and quality checks pass.
  3. Alexandre-T commented on Oct 1, 2026

    @Alexandre-T
    ContributorAuthor

    Definition of Ready — validated

    This Story is Ready for implementation.

    The geometry coverage is now explicitly defined and removes the remaining implementation ambiguity:

    • geometry types currently implemented by spatial-types are identified and must be decoded;
    • recognized instantiable types not yet implemented by spatial-types are explicitly listed and must raise NotYetImplementedException;
    • non-instantiable GeometryTypeEnum values are explicitly identified and handled separately;
    • POLYHEDRALSURFACE dimensional limitations are distinguished from missing type implementations;
    • expected behavior for supported, unimplemented, non-instantiable, empty, and nested geometries is covered by the acceptance criteria.

    The implementation scope and expected outcomes are therefore sufficiently precise and testable.

    Status: READY.

  4. linked a pull request that will close this issuefeat: complete EWKT geometry coverage #40on Oct 2, 2026
  5. self-assigned this
    on Oct 4, 2026
  6. changed the title [-]Complete EWKT geometry coverage and compatibility validation[/-] [+]Story: Complete EWKT geometry coverage and compatibility validation[/+] on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

spatial:geometryRelated to geometry models or types

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions