Repository navigation
feat(geojson): encode MultiPolygon geometries - #23
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
READY FOR MERGE — PR #23, revision d8cebd1, satisfies Story #14. |
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.