Skip to content

feat(geojson): encode MultiLineString geometries - #21

Merged
Alexandre-T merged 1 commit into
mainfrom
feat/12-geojson-multilinestring
Sep 21, 2026
Merged

Alexandre-T merged 1 commit into
mainfrom
feat/12-geojson-multilinestring

Conversation

@Alexandre-T

Copy link
Copy Markdown
Contributor

Closes #12.

GeoJsonStrategy now encodes Geometry and Geography MultiLineStrings in XY and XYZ, preserving every line, position, member order and Z value. An aggregate with no members emits an empty coordinates array; any EMPTY or singleton LineString member throws UnsupportedGeometryStructureException before JSON is returned.

The implementation adds one private encoder using the existing model coordinate arrays and shared dimension, interface and JSON exception contracts. SRID/reference metadata remains omitted, measured dimensions remain rejected including EMPTY, and antimeridian crossings are preserved unchanged. No new public symbols, dependencies, architecture changes or breaking changes are introduced; the approved Story contracts apply.

RFC 7946 sections 3.1.4–3.1.5 define line and MultiLineString coordinate structure. The approved EMPTY policy and deliberate non-application of antimeridian cutting in section 3.1.9 are documented in docs/strategies.md, with usage and caller responsibilities. Other geometry contributions remain out of scope.

Validation:

  • vendor/bin/phpunit --no-coverage --filter 'MultiLineStringTest|ExceptionContractTest': 56 tests, 185 assertions passed.
  • composer test: 876 tests, 1355 assertions passed on PHP 8.4.25 with PCOV.
  • composer quality: passed (PHP CS Fixer, PHPStan level 9, PHPMD and PHP_CodeSniffer). Existing PHPMD/PDepend dependencies emit PHP 8.4 deprecation notices without violations.
  • git diff --check: passed.

GeometryMultiLineStringTest and GeographyMultiLineStringTest cover concrete XY/XYZ examples, empty aggregates, EMPTY first/last/all members, singleton members, measured inputs, order, reference metadata and antimeridian crossings. ExceptionContractTest covers JSON failure chaining using a model-supported non-finite coordinate and preserves the internal interface exception contract.

Independent review and CI remain required before the Product Owner's merge decision. No unresolved implementation gate was identified.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4340529) to head (64acd24).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #21   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       156       161    +5     
===========================================
  Files             14        14           
  Lines            287       296    +9     
===========================================
+ Hits             287       296    +9     

☔ 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

READY FOR MERGE — PR #21, commit 64acd24.

No blocking findings or unresolved Gates.

  • All six criteria from Story: Encode MultiLineString geometries as GeoJSON #12 and the shared criteria are satisfied: Geometry/Geography families, XY/XYZ, EMPTY, XYM/XYZM rejection, ordering, Z, references, exceptions, and antimeridian handling.
  • Structure verified against RFC 7946 §§3.1.4–3.1.5. The EMPTY and antimeridian policies follow the approved and documented decisions.
  • Changes are limited to the existing strategy, with no additional dependencies, migrations, or breaking changes. English documentation is complete.
  • Independent checks: composer test passed with 876 tests / 1,355 assertions; composer quality and git diff --check also passed. Dependency deprecation notices from PHPMD/PDepend are present, with no violations.
  • Both CI workflows for the commit passed; the workspace is clean and HEAD is unchanged.

The applicable Definition of Done requirements prior to merge are satisfied. No GitHub review has been published and no merge has been performed. The merge decision and final post-merge verification are still required; the Story is not declared Done.

@Alexandre-T
Alexandre-T merged commit 745a906 into main Sep 21, 2026
3 checks passed
@Alexandre-T
Alexandre-T deleted the feat/12-geojson-multilinestring branch September 21, 2026 17:34
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: Encode MultiLineString geometries as GeoJSON

2 participants