Skip to content

@bloomsparkagency/imdf - IMDF Parser & Validator

The IMDF package is a highly performant, in-browser parser, validator, and exporter supporting the OGC / Apple Indoor Mapping Data Format (IMDF) 1.0.0 specification. It runs inside a Comlink Web Worker, unpacking and validating datasets without locking the browser's UI thread.


📂 Required IMDF File Taxonomy

A valid .imdf.zip contains separate GeoJSON layers. The parser verifies both mandatory and optional layers:

Mandatory LayersOptional Layers
manifest.jsonaddress.geojson
venue.geojsonamenity.geojson
building.geojsonanchor.geojson
level.geojsondetail.geojson
unit.geojsonfixture.geojson
footprint.geojsongeofence.geojson
kiosk.geojson
occupant.geojson
opening.geojson
relationship.geojson
section.geojson

🩺 In-Browser Schema Validation & Integrity Rules

The validator implements three cascading logic steps inside the worker:

  1. Ajv Property Schema Checks: Enforces JSON Schema Draft-07 syntax constraints (~8 KB gzipped) on property keys, data types, and enum vocabulary.
  2. Geometry Rules Validation: Validates that GeoJSON feature shapes conform to literal IMDF standard rules:
    • Building: Geometry MUST be null ("geometry": null).
    • Footprint, Level, Unit, Venue, Section, Kiosk, Geofence, Fixture: Geometry MUST be Polygonal (Polygon or MultiPolygon).
    • Opening: Geometry MUST be LineString ("geometry": { "type": "LineString", ... }).
    • Amenity, Anchor: Geometry MUST be Point ("geometry": { "type": "Point", ... }).
    • Detail: Geometry MUST be LineString or MultiLineString.
  3. Integrity Validation Checks: The parser evaluates cross-layer spatial linkages and raises structured warnings/errors:
Violation CodeSeverityDescription
FileMustBeValidGeoJSONViolation (Error)Input file is not valid JSON or lacks standard GeoJSON root properties.
ManifestVersionMustBeValidViolation (Error)manifest.json does not declare version: "1.0.0".
VenueCountMustBeExactlyOneViolation (Error)The archive contains zero or more than one venue feature.
BuildingMustHaveAtLeastOneFootprintViolation (Error)A building record has no matching footprints defined in footprints.geojson.
InvalidFeatureIDViolation (Error)The feature ID is missing or is not a valid RFC-4122 v4 UUID string.
VenueMustHaveAddressViolation (Error)The single venue record has no registered address_id binding.
OpeningIsSuspiciouslyLargeWarningAn opening LineString feature's length exceeds 45 meters.
OpeningIsSuspiciouslySmallWarningAn opening LineString feature's length is less than 0.8382 meters (33 inches).
LevelMustBeFullyCoveredByUnitsWarningThe combined polygons of all units do not cover the footprint of the level (indicates unmapped corridors).

💾 Export Profiles

The editor state can be exported as a compiled, zipped archive conforming to either Apple or Microsoft requirements.

1. Apple Indoor Maps Program Profile

Generates archives designed to pass Apple's strict Indoor Survey / Business Register submission gates:

  • Enforces all 16 IMDF feature types.
  • Enforces v4 UUID IDs for all layers.
  • Includes mandatory display_point coordinates on Venue, Building, Level, and Unit shapes.
  • Preserves the original origin UUID in manifest.json across incremental updates to allow Apple to trace changes easily.

2. Microsoft Places Profile

Generates lightweight archives structured for Microsoft Places desk and space bookings (requires only 4 required GeoJSON layers):

  • The 4 Core Layers: building.geojson, footprint.geojson, level.geojson, unit.geojson (plus optional section.geojson and fixture.geojson for desk layouts).
  • SortOrder Synchronization: The level ordinal value is mapped to match the SortOrder property in the Microsoft Places Directory.
  • Microsoft-Specific Extensions: Injects custom metadata extensions: bearing on levels and rotation on fixtures (to capture precise desk angles).
  • Correlation Map Template: Automatically creates a companion mapfeatures.csv file referencing corresponding building assets, allowing administrators to execute PowerShell mapping imports immediately:
    powershell
    Import-MapCorrelations -MapFilePath "imdf.zip" -CorrelationsFilePath "mapfeatures.csv"
    New-Map -BuildingId <PlaceId> -FilePath "imdf_correlated.zip"

Released under commercial licensing.