Skip to content

Story: Align line classification with the two-point definition #59

Closed

Description

@Alexandre-T

Align line classification with the two-point definition

As a consumer of spatial curve predicates,
I want mutable and immutable line strings to apply the same normative line definition,
so that classification does not depend on the object's mutability.

Context

Finding R1 of the Story #26 audit:
LineStringImmutable([[0,0],[1,1],[2,2]])->isLine() returns true, while
the mutable equivalent returns false. The common LineStringInterface
documents exactly two defining points.

ISO/IEC CD 13249-3:201x(E), clauses 4.2.5 and 7.2.1 Description 8, and
OGC 06-103r4, clause 6.1.7.1 agree on the two-point definition.
The immutable closure implementation currently calls isLine(), so a
classification correction must preserve independent closure behavior.

This finding blocks the 1.0.0 normative baseline and public-contract
stabilization. On 2026-10-30, Alexandre explicitly approved the correction:
both mutable and immutable three-point line strings must return false because
a line contains exactly two points. This records the API/compatibility decision
for R1; it does not resolve the separate R3/R4 contracts.

Acceptance Criteria

  • isLine() returns true exactly when the line string has two defining point entries, for both mutable and immutable variants.
  • Empty, one-point and three-or-more-point line strings return false from isLine().
  • Closed line strings with more than two defining points remain closed according to the separately approved closure contract.
  • Classification does not mutate coordinates, members, context or the original immutable object.

Constraints

  • Apply the line definition in ISO/IEC CD 13249-3:201x(E), clauses 4.2.5 and 7.2.1 Description 8, with supporting OGC 06-103r4, clause 6.1.7.1.
  • Do not reintroduce functional constructor validation removed by Task — Remove functional validation from spatial-types #33.
  • Do not resolve equality, Z/M closure or EMPTY aggregate semantics from audit R3/R4 in this correction.

Definition of Done

The project's common Definition of Done applies.

  • composer test-local passes.
  • composer quality passes.
  • Explicit regressions cover XY, XYZ, XYM and XYZM, both families, both mutability variants, and a closed line string with more than two points.
  • Public documentation and the Story: Review normative conformance for spatial-types 1.0.0 #26 conformance matrix reflect the approved contract and final verification.
  • The API and compatibility correction was explicitly approved by Alexandre on 2026-10-30 and recorded above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    impact:apiAffects the public APIspatial:geometryRelated to geometry models or typesstandard:complianceImproves or restores standards compliancestandard:isoRelated to ISO spatial standardsstandard:ogcRelated to OGC specifications

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions