Why gates, and not just a success message
A script that finishes without an exception may still have written a line outside a building or two areas that overlap. The database does not report such errors, because for it these are valid rows. They come to light only on the map. A consistency gate is a control query that counts one specific defect. The rule is simple: the script writes data only when all the gates return zero.
The gates are run first in rollback-trial mode. The trial report shows the counts after each gate, and only a clean report opens the way to write mode. A backup of the structure is made before writing, and the migration is repeatable.
Geometric gates
The first group of gates concerns shapes. The children of a building must fit inside the outline reduced by the wall thickness, which is 1 m on each side in the example from the documentation. The migration gate requires zero lines extending beyond the building's volume. If a line protrudes through the wall, it would appear on the map as an object outside the building, and a worker assigned to that line would be shown outside the plant hall.
The second gate concerns overlaps. Lines inside a building may not inherit the full outline of the building, nor may they overlap on the same level: they receive disjoint areas inside the building. If two lines occupied the same area, it would not be clear to which of them a given position belongs. The gate counts pairs of lines overlapping on the same level and must return zero.
Sample gate results across two trials: number of violations
- Trial 1
- Trial 2
Identity and reference gates
The third group concerns duplicated points and references. It is worth checking that no two locations have the same identifier or the same position, that every line has a parent building and every building a parent view. Data from the existing system is moved with its identifiers preserved, and new items receive numbers from a separate range, so the gate can also check that the new numbers do not fall inside the source range.
The fourth gate concerns floors: floor rows should be created only for buildings with more than one level. A building with a single ground floor without such a row is correct, and adding one would cause the level panel to show the floors of other buildings.
How to confirm that a gate really works
A gate that has never been seen to turn red is a hypothesis. Each gate therefore has a test in which a known defect is injected: you add a line outside the wall, an overlapping area or a duplicated point to the test data, and confirm that the gate reports exactly that defect. Only then does a zero on real data mean something.
The gates are complemented by a verification of coordinates on control points converted back with the same transformation function as the editor. Example from the documentation: a maximum error of 0.01 m across 64 control points.
Checklist
Video
Frequently asked questions
Can I skip a gate when the data looks fine?
No. Geometric defects, such as a line outside the wall, are not visible in a data table and show up only on the map. A gate gives evidence; an impression does not.
What does zero in a gate mean?
The check query found no violations. Zero means something only if the gate was tested on data with an injected error.
Do the gates run only once?
No. The migration is repeatable, so the gates run at every trial and before every write.
Planning a plant structure migration?
We will design the consistency gates and the rollback trial with you, so that the write happens only after a clean report.
Let's talk