Geospatial coordinates arrive distorted all the time: bad georeferencing, projection mismatches, sensor warp. MapFix is the interactive, clickable face of "detect and undo that distortion." You give it points; it models the distortion as a smooth field, inverts it by fixed-point iteration, and shows the residual error and how much area it recovered, live. It is the lightweight demo of the same distortion-aware geometry theme that runs, at more depth, through the author's satellite-splatting (camera Jacobians) and SAR/optical co-registration work.
server.py, ~457 LOC) plus a browser front-end, not a trained model. The distortion-and-correction math is real and deterministic and runs; the distortion itself is a synthetic, parametric model (a "Mercator repair" profile with curve/shear knobs), so it demonstrates the method on controllable distortion rather than on real misregistered maps. The OpenAI calls are an optional flavor layer; without a key it falls back to a deterministic summary, so the demo runs offline.raw = clean + D(clean); inversion is the fixed-point iteration clean ← raw - D(estimate), which converges when D is a contraction.The gradient_at routine finite-differences the distortion field for a local 2×2 Jacobian, used to diagnose convergence, conceptually the numerical cousin of the closed-form camera Jacobians in the author's sat-splat work. The LLM never touches the geometry; that stays in the deterministic engine.
| Component | Status |
|---|---|
| Georeferencing on the real Web Mercator distortion (TPS) | Reproduced: a thin-plate spline fit to real GCPs against the genuine Web Mercator projection cuts held-out ground RMSE from ~1,338 km (raw) / ~24 km (affine) to ~2.5 km (89% better than affine); see EVIDENCE |
| Distortion model + fixed-point correction + metrics | Real, deterministic, runs. Illustrative demo: recovers ~72% of the distortion (mean residual ~2.8 px) on a synthetic Mercator-repair profile |
| Interactive browser demo | Real, live |
| OpenAI text + image layer | Real but optional (falls back without a key) |
| Correction of real scanned misregistered maps | Not yet (the interactive demo's distortion is synthetic; the reproduced RMSE above uses the real Web Mercator distortion) |
The thin-plate-spline georeferencing on real GCPs against the real Web Mercator distortion is done (held-out RMSE above). Next: extend to real scanned maps with manually digitized GCPs (lens/rubber-sheet warp), and add a 2nd-order polynomial baseline alongside affine and TPS.
Estimate and invert a coordinate warp, the principle at its simplest and most demo-able.
The same distortion-aware geometry with closed-form camera Jacobians and real SAR↔optical sensor co-registration. One continuous distortion-aware story.