Summary
exportImdfDataset silently coerces non-level polygons (section, geofence, etc.) into unit exports and rewrites relationship parent feature types.
Evidence
src/lib/imdf/export.ts:450-452 includes all non-level polygons in unitSourceFeatures.
src/lib/imdf/export.ts:544-548 exports all of those as feature_type: "unit".
src/lib/imdf/export.ts:639-643 rewrites section/geofence parents to feature_type: "unit" in generated relationships.
Why this is a bug
Feature typing is not preserved. A dataset containing sections or geofences is transformed into units on export, causing semantic corruption and lossy round trips.
Reproduction
- Build features containing
section and/or geofence polygons.
- Call
exportImdfDataset(...).
- Inspect
unit.geojson and relationship.geojson; section/geofence semantics are collapsed to unit.
Expected
Preserve each IMDF feature type in its proper collection and relationship references.
Impact
Loss of meaning and incorrect downstream behavior for consumers relying on section/geofence semantics.
Summary
exportImdfDatasetsilently coerces non-level polygons (section,geofence, etc.) intounitexports and rewrites relationship parent feature types.Evidence
src/lib/imdf/export.ts:450-452includes all non-level polygons inunitSourceFeatures.src/lib/imdf/export.ts:544-548exports all of those asfeature_type: "unit".src/lib/imdf/export.ts:639-643rewrites section/geofence parents tofeature_type: "unit"in generated relationships.Why this is a bug
Feature typing is not preserved. A dataset containing sections or geofences is transformed into units on export, causing semantic corruption and lossy round trips.
Reproduction
sectionand/orgeofencepolygons.exportImdfDataset(...).unit.geojsonandrelationship.geojson; section/geofence semantics are collapsed to unit.Expected
Preserve each IMDF feature type in its proper collection and relationship references.
Impact
Loss of meaning and incorrect downstream behavior for consumers relying on section/geofence semantics.