Skip to content

feat(geojson): encode MultiPolygon geometries - #23

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

Alexandre-T merged 1 commit into
mainfrom
feat/14-geojson-multipolygon

Conversation

@Alexandre-T

Copy link
Copy Markdown
Contributor

Closes #14.

GeoJsonStrategy now encodes Geometry and Geography MultiPolygons in XY and XYZ, preserving Polygon, ring and position order and Z. Aggregates without members produce {"type":"MultiPolygon","coordinates":[]}. Any EMPTY Polygon or incompatible ring rejects the complete conversion with UnsupportedGeometryStructureException.

The internal handler calls the existing Polygon encoder for each member, reusing the approved signed-area orientation policy. Shared dimension, reference omission, unsupported type/interface and JSON exception contracts remain unchanged. RFC 7946 sections 3.1.6 and 3.1.7 define the representation; the approved antimeridian preservation policy and caller responsibilities remain documented. No new public API, dependency, architectural decision or breaking change is introduced. Binary strategies are unchanged; binary examples do not apply.

GeometryMultiPolygonTest and GeographyMultiPolygonTest cover literal XY/XYZ examples, singleton and empty aggregates, member/ring/position order, reference omission, antimeridian preservation, mixed/all-EMPTY members, incompatible exterior/interior orientation, zero area, and XYM/XYZM rejection including EMPTY. ExceptionContractTest covers the unchanged missing-interface exception and real non-finite altitude encoding with the original JsonException preserved. English strategy documentation and testing notes are updated.

Validation:

  • vendor/bin/phpunit --no-coverage --filter MultiPolygonTest: 30 tests, 90 assertions passed.
  • composer test: 946 tests, 1521 assertions passed.
  • composer quality: passed; existing PHPMD/PDepend dependency deprecation notices under PHP 8.4 remain.
  • git diff --cached --check: passed.

Ready for independent review. No Reviewer agent was launched, as explicitly requested by Alexandre. This PR is not merged and the Story is not declared Done.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ae1e3c) to head (d8cebd1).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #23   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       173       178    +5     
===========================================
  Files             15        15           
  Lines            317       328   +11     
===========================================
+ Hits             317       328   +11     

☔ 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 #23, revision d8cebd1, satisfies Story #14.
No blocking findings or unresolved gates were identified. The implementation preserves coordinates, Z and ordering, rejects EMPTY members and incompatible rings, and reuses the approved Polygon orientation checks. Tests and English documentation cover the applicable requirements, consistent with RFC 7946 and the approved LongitudeOne policies.
I verified successful CI results for PHP 8.4 and all four quality tools and PHP 8.5. Applicable pre-merge Definition of Done requirements are satisfied.
This was a read-only review: I did not rerun tests, modify files, or publish anything to GitHub. Merge and final verification remain required before the Story becomes Done.

@Alexandre-T
Alexandre-T merged commit 94d407f into main Sep 21, 2026
3 checks passed
@Alexandre-T
Alexandre-T deleted the feat/14-geojson-multipolygon branch September 21, 2026 19:23
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 MultiPolygon geometries as GeoJSON

2 participants