Skip to content

feat(geojson): preserve geometry collection structure - #24

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

Alexandre-T merged 1 commit into
mainfrom
feat/15-geojson-collections

Conversation

@Alexandre-T

Copy link
Copy Markdown
Contributor

Closes #15.

GeoJSON now encodes GeometryCollection and GeographyCollection recursively, preserving member types, order, nesting, singleton/homogeneous forms, EMPTY objects and Z. All six existing geometry encoders are reused; unsupported types and incompatible structures propagate their existing exceptions without partial output.

The existing dimension check rejects measured collections, including EMPTY. The real model enforces matching member dimensions, families and references. Reference metadata remains omitted and coordinates unchanged; JSON failures retain their original exception. No public signature, dependency or existing strategy behavior changes; no breaking change or unresolved gate.

English documentation explains the approved preservation policy despite RFC 7946 §3.1.8 SHOULD guidance, its interoperability trade-off and caller responsibilities, including unchanged antimeridian crossings (§3.1.9).

Validation:

  • 32 real Geometry/Geography collection tests cover all six integrated member types, XY/XYZ, EMPTY, nesting, singleton/homogeneous forms, order, reference omission, antimeridian preservation, measured rejection and member failures.
  • ExceptionContractTest covers a missing collection interface and nested real non-finite member with the original JSON exception preserved.
  • composer test: 980 tests, 1636 assertions passed.
  • composer quality: passed; existing PHPMD/PDepend dependency deprecation notices remain.
  • git diff --check: passed.

Independent review has not been launched, as explicitly requested by the Product Owner. The Story is not Done and this PR is not merged.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (94d407f) to head (2f6c9e9).

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #24   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       178       182    +4     
===========================================
  Files             15        15           
  Lines            328       336    +8     
===========================================
+ Hits             328       336    +8     

☔ 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
Alexandre-T merged commit f56780b into main Sep 21, 2026
3 checks passed
@Alexandre-T
Alexandre-T deleted the feat/15-geojson-collections branch September 21, 2026 19:37
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 GeometryCollections while preserving their structure

2 participants