A depot dashboard combines moving vehicle points, fixed facility points, and service rectangles. One index cannot answer every query with the same update cost. Keep an exact dictionary of moving coordinates, an exact list of static points, and an exact list of service boxes in the test program. Compare spatial-hash radius answers after each move, quadtree and Morton window answers against half-open rectangle scans, and bounding-volume overlap answers against closed-box scans. State the coordinate model before testing. These examples use a planar grid; treating degrees of latitude as planar distance would turn an otherwise correct index into a wrong application result.
Project: audit moving points and static spatial boxes
Acceptance trace
Move valve-19 from nine, five to one, six in a cell-size-eight moving grid and query radius four around zero, five. Insert fixed facilities at 47,52; 19,61; 52,58; and 180,70. A half-open window from x 15 to 60 and y 45 to 65 should return the first three from both quadtree and Morton index. Build four service boxes, then query closed box 40,40 through 75,55; the bounding hierarchy should return the three boxes that overlap, including a boundary touch. Confirm that an absent or inverted query fails according to each API rather than silently changing its geometry.
Expected review record
moving-near=[pump-47, sensor-61, valve-19]
static-window=[pump-47, sensor-61, valve-19]
box-overlap=[pump-47, sensor-61, valve-19]Boundary and cost review
Probe negative grid coordinates, moves across cell boundaries, identical quadtree coordinates, points on half-open edges, tiny and empty windows, boxes touching only at one edge, and many boxes whose enclosures overlap the same query. For Morton order, count how many square-code intervals a thin window creates. Compare query candidates with exact outputs after every randomized operation. Explain why a moving-point hash grid pays for enumerated cells, why a fixed-domain quadtree can crowd at its depth limit, why a static bounding hierarchy needs rebuild or refit after movement, and why Morton code sorting alone does not make every geometric query one contiguous range.
Common Mistakes
- Do not leave moved points in old hash cells.
- Do not mix half-open point windows with closed box intersection.
- Do not report a BVH parent hit without a leaf test.
- Do not collapse every Morton rectangle to one code interval.
