Skip to content

feat: support CompoundCurve in WKT and EWKT decoding - #45

Merged
Alexandre-T merged 2 commits into
mainfrom
43-story-support-compoundcurve-in-wkt-and-ewkt-decoding
Oct 5, 2026
Merged

Alexandre-T merged 2 commits into
mainfrom
43-story-support-compoundcurve-in-wkt-and-ewkt-decoding

Conversation

@Alexandre-T

Copy link
Copy Markdown
Contributor

Pull Request

Closes #43

Summary

Decode COMPOUNDCURVE in WKT and EWKT into dimension-specific CompoundCurveInterface objects. Preserve ordered linear/circular components, coordinates, EMPTY values and EWKT SRID; delegate continuity and structural invariants to spatial-types.

Linear components use parenthesized coordinates, while circular components retain their CIRCULARSTRING keyword. Typed LINESTRING components are rejected in both dialects, with regression coverage. README examples and supported-type information are updated.

Acceptance criteria

  • All acceptance criteria are implemented.

Tests cover mixed and single-family components, open/closed curves, all four dimensions, EMPTY, collection nesting, SRID propagation/rejection, disconnected components, malformed syntax, and exception wrapping.

Validation

  • Relevant tests pass.
  • Repository quality checks pass.
  • Regression tests were added when fixing a bug.

Commands run

vendor/bin/phpunit --filter CompoundCurve --no-coverage
composer test
/opt/homebrew/opt/php@8.4/bin/php vendor/bin/phpunit --no-coverage
composer quality
git diff --check

Full suite: 438 tests, 2465 assertions on PHP 8.5.11 and PHP 8.4.26. Quality: CS Fixer, PHPStan level 9, PHPMD production/tests and PHPCS pass. Installed PDepend tooling emits deprecations under PHP 8.5 without failing checks. GitHub Actions remain to be verified after publication.

Standards

  • Applicable normative requirements were verified.

Normative references

ISO/IEC CD 13249-3:201x(E), available Committee Draft dated 2009-01-16, clause 5.1.57, printed page 145: <compoundcurve text> and <single curve text>. Linear components use <linestring text body> and circular components use <circularstring text representation>. EWKT retains the existing extension rules.

Architecture

  • No architectural boundary is affected.

Architecture decision

Shared textual parser and dimension-specific factory follow existing decoder conventions. Domain continuity validation remains in spatial-types.

Compatibility

  • Public API changes were explicitly approved.
  • No breaking change is introduced.

API approval: #43 (comment)

Documentation

  • Documentation was updated where required.

Developer handoff

Important implementation decisions

Components remain separate domain curves. Unsupported component tokens and inconsistent dimensions fail through the existing decoder exception contract. Domain failures preserve their original cause.

Compatibility considerations

Previously supported geometries retain existing behavior. WKT still rejects SRID prefixes and requires non-XY dimension markers. The new COMPOUNDCURVE support replaces its previous NotYetImplementedException.

Remaining risks or questions

Independent review and required GitHub Actions remain pending. No unresolved governance gate; no merge requested.

@Alexandre-T Alexandre-T linked an issue Oct 5, 2026 that may be closed by this pull request
33 tasks done
@codecov-commenter

codecov-commenter commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.43%. Comparing base (c9ee518) to head (b962db6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #45      +/-   ##
============================================
+ Coverage     99.39%   99.43%   +0.04%     
- Complexity      234      252      +18     
============================================
  Files            29       31       +2     
  Lines           492      534      +42     
============================================
+ Hits            489      531      +42     
  Misses            3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Alexandre-T

Copy link
Copy Markdown
Contributor Author

Independent review — READY FOR MERGE

Reviewed revision: 60cf1b938cd35ed2465daa4bcce32771391c791f.

I independently reviewed Story #43, its acceptance criteria and API approval comment, the implementation and tests, and the applicable LongitudeOne governance, architecture, standards and serialization guidance. I am the Reviewer agent, not the Developer agent that authored this implementation. This assessment is posted as a comment because the authenticated GitHub account also owns the PR.

Both findings from the initial local review are resolved:

  • Typed LINESTRING components are rejected in WKT and EWKT, with regression coverage. Positive fixtures now use parenthesized linear components. This matches the locally verified ISO/IEC CD 13249-3:201x(E), Committee Draft dated 2009-01-16, clause 5.1.57, printed page 145, productions <single curve text> and <linestring text body>.
  • README documents CompoundCurve decoding, its component syntax, dimensions, SRID and validation behavior, and no longer claims that the decoder rejects this implemented type as unavailable.

Acceptance criteria and applicable pre-merge Definition of Done were considered: recognition in the shared parser, CompoundCurveInterface results, EMPTY, linear/circular/mixed components, exact coordinate and component preservation, open/closed curves, XY/XYZ/XYM/XYZM, dimension consistency, EWKT SRID propagation, WKT SRID rejection, malformed/disconnected input, exception wrapping, regression coverage and user documentation are satisfied. Structural invariants remain delegated to spatial-types. The approved API scope is respected; no additional architecture, breaking or unresolved normative gate was identified.

Independent validation on this revision:

  • PHP 8.5.11: composer test — 438 tests, 2465 assertions passed.
  • PHP 8.4.26: vendor/bin/phpunit --no-coverage — 438 tests, 2465 assertions passed.
  • CS Fixer in dry-run mode, PHPStan level 9, PHPMD for production/tests, PHPCS and git diff --check completed without violations. Installed PHPMD/PDepend dependencies emit deprecation notices, without reported code violations.
  • GitHub checks independently inspected for this exact head: PHP 8.4 build, PHP 8.5 build and GitGuardian all completed successfully.
  • Local working tree is clean and matches the PR head.

No blocking findings or unresolved gates remain. No code was changed during this review. This verdict does not merge the PR or declare Story #43 Done: Alexandre's merge decision and the post-merge Definition of Done verification remain outstanding.

@Alexandre-T

Copy link
Copy Markdown
Contributor Author

Independent review update — READY FOR MERGE

Reviewed revision: 1da96d152a0866544fd850d8ebd4c08acb16c5b6.

The incremental diff adds only CompoundCurveWktParserTest; production code is unchanged. I independently reviewed both tests: a dispatcher returning a component with an incompatible dimension exercises the guard at parser line 122; a dispatcher returning an unexpected geometry with the expected dimension exercises line 128. Each test verifies the decoder exception type, its diagnostic message and the dispatcher invocation. These are direct defensive-contract tests, supplementing the existing real-input decoding tests.

Independent validation of the committed revision:

  • PHP 8.5.11: composer test passed — 440 tests, 2473 assertions.
  • PHP 8.4.26: full suite passed — 440 tests, 2473 assertions.
  • The Clover report regenerated by my PHP 8.5 run records count="1" for both lines 122 and 128 of CompoundCurveWktParser.php, with 29/29 statements and 4/4 methods covered. This establishes statement/method coverage; it is not a claim of complete branch coverage.
  • The exact PR head was checked independently: PHP 8.4, PHP 8.5 and GitGuardian checks all completed successfully. The PHP 8.4 workflow includes the repository quality checks.
  • git diff --check passed for the incremental commit.

The previous review conclusions remain applicable. No blocking finding or unresolved gate was introduced, and the requested uncovered paths are now tested. This verdict applies specifically to the SHA above; later uncommitted or committed edits are outside this assessment. No code was modified by the Reviewer and no merge was performed. Story completion still requires merge and post-merge Definition of Done verification.

@Alexandre-T
Alexandre-T force-pushed the 43-story-support-compoundcurve-in-wkt-and-ewkt-decoding branch from 1da96d1 to b962db6 Compare October 5, 2026 13:07
@Alexandre-T
Alexandre-T merged commit 7716725 into main Oct 5, 2026
3 checks passed
@Alexandre-T
Alexandre-T deleted the 43-story-support-compoundcurve-in-wkt-and-ewkt-decoding branch October 5, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Story: Support CompoundCurve in WKT and EWKT decoding

2 participants