How to fix IMDF validation errors: 103 to 0 on a real file
Most IMDF validation errors come from a short list of causes: coordinates in the wrong projection, a venue or level that does not cover the rooms inside it, invalid geometry, and rooms that the routing cannot reach. To show what that looks like, we took a public IMDF test file that failed with 103 errors and 46 warnings, fixed it step by step, and ended at 0 errors and 0 warnings. This guide follows that file.
What was wrong with the file?
The file is an open IMDF test dataset published for third-party map editors, with a layout that matches a university building. We ran it through our validation script, the same gate we require before publishing any venue. It reported 103 errors, 46 warnings and the verdict BLOCKED. Grouped by rule, the 103 errors were:
| Count | Rule | What it means |
|---|---|---|
| 83 | Unit must be covered by venue | Rooms fall outside the venue polygon |
| 18 | Unit must be covered by its level | Rooms fall outside the floor they belong to |
| 2 | Invalid geometry | A polygon that cannot be used as drawn |
The 46 warnings were 18 pairs of overlapping rooms, 17 pairs of rooms sharing a wall edge, 9 anchors sitting outside their room and 2 rooms with no connection to a corridor. They do not stop a validator, but each one breaks routing in a specific way, covered below.
Fix 1: Check the projection first
Almost everything above traced back to one thing. IMDF is GeoJSON, so coordinates must be longitude and latitude in degrees (WGS84). In this file, 83 of the 84 units had X values around 11,774,224 and Y values around 1,122,453. Those are Web Mercator meters (EPSG:3857) that had never been reprojected. A validator compares rooms with the venue, and when the two sit in different coordinate systems the overlap tests produce nonsense: some "uncovered" areas came out in the hundreds of billions of square meters.
- Symptom: coordinates in the millions, or a map that shows nothing near the real building.
- Check: open one GeoJSON file and look at a coordinate. Longitude is between -180 and 180, latitude between -90 and 90.
- Fix: reproject every file to EPSG:4326 in one pass, with one script, so the files stay consistent with each other.
Fix 2: One venue, one building, real levels
Reprojecting alone did not finish the job. In our run it brought the errors from 103 to 94, because the structure of the file was also wrong. The venue file held 30 features instead of one: a tiny placeholder square at the origin (coordinates 100, 0), a shopping-centre polygon and 28 separate polygons of the surrounding campus. There were 3 buildings and 4 levels, where the real data described one building with two floors.
- Symptom: "Unit must be covered by venue" on nearly every room, even after reprojection, and invalid geometry on the venue.
- Fix: keep one venue polygon that fully covers the building and its levels, one building with its footprint, and only the levels that have rooms. Remove placeholder shapes.
- Result here: 1 venue, 1 building, 2 levels. Two of the 84 original units could not be recovered (one was the placeholder at the origin) and were dropped, leaving 82.
Fix 3: Make every room fit inside its level
The remaining coverage errors are the geometric kind: a room that sticks out past the edge of its floor. Clip each unit to its level polygon and treat the level as the ground truth, never the other way around. Level polygons are the outline you can check against the basemap; rooms are the data that drifts.
Fix 4: Separate neighbouring rooms
Eighteen warnings were overlaps, and seventeen were rooms that shared a wall edge exactly. Both look harmless on a map. For routing they are not: if two rooms touch with no gap, a shortest-path search can pass straight through the wall instead of using the corridor.
- Trim overlaps so each point of floor belongs to one unit.
- Leave a gap of more than half a meter between adjacent rooms.
- Let rooms share an edge only with the corridor they open onto.
Fix 5: Connect every room to a corridor
Two rooms were not connected to any walkway, so no route could ever reach them. The fix is to snap the room's border to the corridor it opens onto. After that, every one of the 50 named places in the repaired file has a route to it.
Fix 6: Put anchors inside their rooms
Nine anchors sat outside the unit they belonged to, so a route to that place would start from the wrong room. Move each anchor to a point inside its unit, ideally near the middle. Note that "inside" is the only thing a validator checks: an anchor squeezed into a corner passes, so it is worth checking the position by eye as well.
What a clean file looks like
| Before | After | |
|---|---|---|
| Errors | 103 | 0 |
| Warnings | 46 | 0 |
| Venues | 30 features | 1 |
| Buildings / levels | 3 / 4 | 1 / 2 |
| Units | 84 | 82 |
| Verdict | BLOCKED | CLEAN |
Passing validation is the entry ticket, not the goal. The goal is a file that renders where it should and routes to every room, which is why we check topology as well as the standard. You can explore the result in the live demo, and see how the format is built in IMDF explained. If you are starting from a drawing rather than a broken file, how to convert a floor plan to IMDF covers the process from the start.
Which validators should I use?
Use more than one. Apple's IMDF Sandbox and the free Safe Software IMDF validator check a file against the standard and against Apple's rules. They will not tell you that a room is unreachable or that two rooms share a wall. For that you need a topology check, either your own script or a service. Hallar runs both kinds before any map is published, and fixing a file like this one is part of what we do for a project fee per building, from €700 (see how much an indoor map costs).
About the data: the file is an open test dataset (CUSCRD/Open-IMDF) that does not declare a licence, so we show it as a demonstration of our QA work and credit its authors. It is not an official map, and the institution is not a Hallar client. If you hold rights to it and want it changed or removed, write to us and we will do it.
Keep reading: how to convert a floor plan to IMDF, IMDF explained and how to create an indoor map.
Have an IMDF file that fails validation?
Send it as it is. We repair it, validate it and send it back with a list of what we changed. We reply within 24 hours.
Free demo · Reply within 24 hours · Prefer email? [email protected]