"The geometer insists the walls do not exist and computes a clean circle. The fingerprinter has walked every corridor and remembers exactly where the signal goes strange. In an office building, I bet on the one who did the walking."
A Well-Surveyed AI Agent
Prerequisites
This section assumes the anchor technologies of Section 25.2: what a Wi-Fi access point, Bluetooth beacon, or UWB anchor measures, and the difference between a received-signal-strength (RSS) reading, a time-of-arrival (ToA) reading, and an angle-of-arrival (AoA) reading. The propagation physics that make signals decay and bend comes from Chapter 2. The two methods here are a concrete instance of the model-based-versus-data-driven split, so the least-squares and nearest-neighbor vocabulary of Chapter 4 and the feature-vector view of Chapter 8 both pay off directly.
The Big Picture
Once you can measure something about a radio signal, you still need to turn that measurement into a position, and there are exactly two philosophies for doing it. The geometric school treats the room as empty space and does trigonometry: if I know my distance to three anchors, I sit where three circles meet. The fingerprinting school treats the room as a fixed pattern of signal quirks and does pattern matching: I walked every spot in advance, wrote down what the radios looked like there, and now I find the recorded spot whose signature most resembles what I see. Geometry needs almost no setup but demands honest physics, which indoors you rarely get. Fingerprinting embraces the messy physics but demands a survey and goes stale when the furniture moves. Nearly every indoor positioning product you have used picks one of these, or quietly blends both, and knowing which one fits your building is the difference between a two-meter fix and a useless one.
Two philosophies for turning signals into positions
The cleanest way to hold these two families apart is by what they assume about the world. Geometric methods assume a propagation model: a known equation linking a measurable quantity to distance or bearing. Fingerprinting assumes a survey: a database of measurements taken at known locations, with no model of why the signal looks the way it does. Geometry is model-rich and data-poor; fingerprinting is model-free and data-rich. That single trade governs everything downstream, from calibration effort to how gracefully each degrades when the environment changes, and it is the same classical-versus-learned axis that runs through this whole book.
The reason the choice is not obvious indoors is multipath. Outdoors, with line of sight to satellites (Section 25.1), signals travel in near-straight lines and the geometric model is close to true. Inside, every wall reflects, every metal shelf scatters, and the signal that reaches your receiver is a sum of paths that arrived by different routes. That wreckage is a liability to the geometer, who assumed a clean straight path, and an asset to the fingerprinter, for whom the very fact that a given corner mangles the signal in a specific, repeatable way is what makes that corner identifiable.
Geometric methods: trilateration, multilateration, triangulation
Geometric positioning converts range or angle observations into coordinates by intersecting loci. With ToA or two-way ranging you get a distance \(d_i\) to anchor \(i\) at known position \(\mathbf{a}_i\), and your position \(\mathbf{x}\) must satisfy \(\lVert \mathbf{x} - \mathbf{a}_i \rVert = d_i\) for every anchor. Two ranges give two circles and an ambiguous pair of intersections; three or more resolve it, which is why the technique is called trilateration. Because the ranges are noisy the circles never meet at a single point, so in practice you solve a least-squares problem
\[ \hat{\mathbf{x}} = \arg\min_{\mathbf{x}} \sum_{i=1}^{M} \bigl( \lVert \mathbf{x} - \mathbf{a}_i \rVert - d_i \bigr)^2, \]the estimation machinery of Chapter 4 applied to circle intersection. When only time differences are available, because the anchors share a clock but the tag does not, each anchor pair defines a hyperbola of constant range difference and you solve the same style of problem over hyperbolae: this is multilateration, the principle behind UWB anchor grids and, historically, LORAN. If instead you measure bearing with an antenna array you get AoA, and two bearings from known anchors cross at your position: triangulation.
The catch is that geometry only works when the observed quantity really encodes geometry. UWB's sub-nanosecond timing gives honest ToA and yields ten-centimeter fixes, so geometry shines there. Wi-Fi and Bluetooth RSS, by contrast, must be converted to distance through a log-distance path-loss model, \(P(d) = P_0 - 10\,n\,\log_{10}(d/d_0)\), and indoors the path-loss exponent \(n\) is neither constant nor known: a wall adds ten dB, a human body adds three, a microwave oven briefly adds twenty. Inverting that noisy curve to a range multiplies the error, so RSS trilateration indoors routinely lands five to ten meters off. Geometry does not fail quietly here; it fails confidently, reporting a crisp wrong answer with no hint that its model was violated.
Key Insight
Geometric and fingerprinting methods fail in opposite directions, and that is the whole reason to care which you pick. A geometric solver assumes the physics and breaks when the physics is wrong (non-line-of-sight, multipath, an unknown path-loss exponent), producing a confident but biased fix. A fingerprint matcher assumes the environment is unchanged and breaks when the environment moves (new walls, added access points, a rearranged warehouse), producing a fix that was accurate last month and is silently wrong today. So the deciding question is never "which is more accurate" in the abstract; it is "which of my two failure modes can I actually control." A stable, surveyed building favors fingerprinting; a well-instrumented UWB space with clean line of sight favors geometry.
Fingerprinting: memorize the radio map, then match
Fingerprinting drops the physics entirely. In an offline survey phase you walk the space and, at each known reference point \(\mathbf{p}_j\), record a feature vector \(\mathbf{f}_j\): typically the RSS from every access point in range, so \(\mathbf{f}_j \in \mathbb{R}^{K}\) for \(K\) access points, with missing APs filled by a floor value. That collection \(\{(\mathbf{p}_j, \mathbf{f}_j)\}\) is the radio map. In the online phase you observe a live vector \(\mathbf{f}\) and return the location whose stored fingerprint is closest. The workhorse is weighted \(k\)-nearest-neighbors in signal space: find the \(k\) survey points with the smallest \(\lVert \mathbf{f} - \mathbf{f}_j \rVert\) and average their coordinates. A probabilistic variant models \(p(\mathbf{f}\mid\mathbf{p})\) at each cell and returns the maximum-likelihood or posterior-mean cell, which additionally yields an uncertainty. Modern systems push richer features than scalar RSS, most notably Wi-Fi channel state information (CSI), whose per-subcarrier amplitude and phase form a far more discriminative signature and pair naturally with the deep encoders of Chapter 13 and the wider RF-sensing toolkit of Chapter 47.
Fingerprinting is where localization becomes a machine-learning problem in the ordinary sense: a labeled dataset (survey points), a feature vector (signal readings), and either a regressor (predict coordinates) or a classifier (predict which room or cell). That framing also imports the usual hazards. A fingerprint database is a dataset like any other, so the leakage-safe discipline of Chapter 5 applies: if you evaluate on survey points collected in the same walk as your training points, spatially adjacent and seconds apart, you measure memorization, not the accuracy a user will get next week. And because the radio map is a snapshot, it decays; an access point that is moved or retired shifts the fingerprints of a whole region, exactly the distribution shift that Chapter 66 studies.
import numpy as np
# Offline: a tiny radio map. Rows are survey points; each has an (x, y)
# and the RSS (dBm) heard from 4 access points. -100 dBm means "not heard".
P = np.array([[0.0, 0.0], [4.0, 0.0], [0.0, 3.0], [4.0, 3.0], [2.0, 1.5]])
F = np.array([[ -45, -70, -72, -88],
[ -70, -44, -85, -71],
[ -73, -86, -46, -69],
[ -88, -70, -71, -45],
[ -63, -62, -61, -60]], dtype=float)
def locate_knn(live, F, P, k=3):
"""Weighted k-NN fingerprint match. live: RSS vector we hear right now."""
d = np.linalg.norm(F - live, axis=1) # distance in signal space
idx = np.argsort(d)[:k] # k closest fingerprints
w = 1.0 / (d[idx] + 1e-6) # closer survey points count more
return (w[:, None] * P[idx]).sum(0) / w.sum()
# Online: stand near the center, hear a noisy version of row 4's fingerprint.
live = np.array([-61, -64, -59, -62], dtype=float)
print(np.round(locate_knn(live, F, P), 2)) # -> approx [2.0, 1.5]
F, not the matching logic.Listing 25.1 makes the contrast with trilateration concrete. There is no path-loss exponent, no circle intersection, no assumption that stronger means closer; there is only "which recorded place looked most like this." That is why fingerprinting tolerates the multipath that defeats geometry, and also why it collapses the moment the recorded places stop being representative.
The Right Tool
Listing 25.1 is deliberately hand-rolled to expose the matching step, but a production locator wants a KD-tree for fast neighbor search over thousands of survey points, plus cross-validated \(k\). scikit-learn gives you both, turning the whole online stage into two lines and dropping roughly 30 lines of tree-building and weighting bookkeeping:
from sklearn.neighbors import KNeighborsRegressor
loc = KNeighborsRegressor(n_neighbors=3, weights="distance").fit(F, P)
xy = loc.predict(live.reshape(1, -1)) # KD-tree neighbor search, weighted average
scikit-learn, which supplies the spatial index, weighting, and a clean path to grid-searching \(k\) with the leakage-safe splits of Chapter 5.Keep the from-scratch version for intuition; ship the library for anything beyond a demo.
In Practice: routing pickers through a fulfillment warehouse
An e-commerce fulfillment center wanted meter-level tracking of the handheld scanners its pickers carry, to route them along shorter paths and flag congestion. UWB anchors on every aisle would have delivered clean ToA geometry, but retrofitting hundreds of anchors across a 30,000-square-meter building was too costly, and the existing Wi-Fi already blanketed the floor. So the team fingerprinted: over two shifts they pushed a survey cart on a marked grid, logging RSS from every access point every half meter, and trained a weighted \(k\)-NN plus a small CSI-based network. It worked at roughly two-meter accuracy, comfortably good enough to route pickers, and the geometric RSS-trilateration baseline they had tried first was hopeless, because the steel racking turned the path-loss exponent into noise. The instructive part came three weeks later: a seasonal re-slotting moved dozens of pallet racks, the fingerprints in those aisles shifted, and accuracy quietly halved until they re-surveyed the changed zones. Geometry would never have gone stale that way; fingerprinting bought accuracy at the price of a standing maintenance survey, and the team decided that trade was worth it.
Choosing, and the hybrid middle ground
The decision reduces to a few honest questions. Do you have a ranging technology whose measurement actually reflects geometry, such as UWB two-way ranging or clean line-of-sight ToA? Then geometry gives you the best accuracy with essentially zero survey and it never goes stale. Are you stuck with RSS from Wi-Fi or Bluetooth in a cluttered indoor space, and can you afford to survey once and re-survey when the space changes? Then fingerprinting will beat geometry by a wide margin. The costs are mirror images: geometry pays in anchor hardware and line-of-sight discipline, fingerprinting pays in survey labor and map maintenance.
In practice the strongest systems refuse the dichotomy. A common hybrid uses coarse geometric or cell-level reasoning to pick a region, then fingerprints within it, cutting both the search and the survey burden. Others feed geometric ranges and fingerprint scores as parallel measurements into a single Bayesian filter (Chapter 9), letting each dominate where it is trustworthy, and then fuse the result with inertial dead reckoning from Section 24.4 to ride through the gaps. That fusion view, rather than a winner between the two schools, is where deployed indoor positioning actually lives.
Exercise
Collect a small radio map with a phone Wi-Fi scanner app: mark a 3-by-3 grid on a room floor, and at each cell log the RSS from every visible access point five times. (1) Build the weighted \(k\)-NN locator of Listing 25.1 and, using leave-one-cell-out evaluation, report the median localization error; contrast it with a naive split that mixes scans from the same cell across train and test, and explain the gap in terms of Chapter 5. (2) Fit a single log-distance path-loss curve to your strongest access point and trilaterate from the three strongest; compare the error to the fingerprint result and attribute the difference to specific walls or objects. (3) Move one access point (or unplug it) and re-run the fingerprint locator without re-surveying; quantify how far accuracy degrades and where.
Self-Check
1. State the core assumption each family makes about the world (a model versus a survey), and name the failure mode that follows directly from each assumption.
2. Why does indoor multipath hurt geometric methods but help fingerprinting? Answer in terms of what each method needs from the signal.
3. A vendor reports 0.9 m fingerprint accuracy from a benchmark where train and test scans came from the same survey walk. Why should you distrust that number, and what would you demand instead?
What's Next
Both families give you a raw position estimate, and both scatter it: geometry jitters with multipath, fingerprinting snaps between survey cells. But a position rarely lives in free space; a pedestrian is on a walkway and a vehicle is on a road, and that constraint is powerful free information. In Section 25.4, we bring in map matching, which snaps noisy fixes onto the road or floorplan network and often halves the error that neither geometry nor fingerprinting could remove on its own.