opencctv.org

How a search for white sands finds the Organ Mountain Pass sunrise

· all posts

At 07:15 this morning the US-70 camera at Organ Mountain Pass had the sun coming up out of the Tularosa Basin, flaring across the lens, with the highway dropping away east into the haze and four trucks parked in the pull-off waiting for the light. It refreshes every 60 seconds. I did not get to it by typing its name. I got to it by typing "white sands", which is 7.9 km away and is not what the camera is called.

A directory of 138,408 live cameras, counted in our own catalogue at 13:12 UTC today, is only as good as its worst search, and the worst searches are for the places people actually want: a village, a beach, a mountain pass, a monument. Those are rarely what a camera is named after.

Camera names are not place names

The highway cameras are the honest example. A Rhode Island DOT camera arrives called 4_02.0_S_CAM Exit 3A - Oak Hill Rd. Route number, milepost, direction, cross street. That is a good name if you are a traffic engineer, and it shares no word with the village two miles up the road that someone is actually searching for.

So the search does text first and geography second. The query goes through PostgreSQL full text search over the camera name, city, state and country. If the text comes back thin, the same words go to a geocoder, Nominatim, which turns them into a point on the earth, and we return the nearest live cameras to that point with the distance attached to each one. Geocoder answers are cached, so the second person to search a place spends nobody's rate limit, ours or OpenStreetMap's.

Thin, not empty

The useful part took a second attempt. Geography originally fired only when the text came back with absolutely nothing, which sounds right and is not, because one weak match is enough to suppress it.

"White sands" at 13:14 UTC today is the case in miniature. Two cameras match those words by text, and both are on Anna Maria Island in Florida: White Sands Pool and White Sands Anna Maria Island. Real places genuinely called White Sands, and almost certainly not the one you meant. Firing the fallback only at zero would have handed you two Florida beach cameras and stopped, pleased with itself.

The threshold is three. Fewer than three text matches and the geography runs as well, both sets come back in one response, and anything in both is deduped by id. That query returned 22 cameras today: the two in Florida first, because a name match is the best answer there is and we are not throwing it away, then the New Mexico ones by distance from the monument. US-70 at Organ Mountain Pass at 7.9 km, I-25 at Lohman in Las Cruces at 24.7 km, and on out into the desert. The response marks the geographic set as supplemental rather than a replacement, so the frontend knows to keep the name matches on top.

Charlottetown is the other half of the same idea. Nothing in the catalogue carries the city's name in its title, so at 13:14 UTC today all 12 results came through geography, and the nearest to the city centre is the Hillsborough Bridge camera at 1.9 km, looking northwest along the causeway. At 10:00 ADT there was a cruise ship alongside in the harbour behind the traffic, which in the middle of October is most of what you need to know about Charlottetown.

Which Wickford

Place names repeat across countries, and the repeats are not evenly interesting. Wickford is a town in Essex and a village in Rhode Island, and the geocoder ranks Essex first, so Essex is what everyone used to get.

The fix is to ask where the searcher is. Cloudflare hands us a two-letter country code on every request, and that code is the first tiebreak between candidate places, ahead of the geocoder's own ranking. I ran the query both ways at 13:14 UTC today. With a US code, "wickford" lands in North Kingstown and the nearest camera is Route 4 at Oak Hill Road, 3.3 km off, which at 09:14 local was four lanes of light morning traffic with the trees on both sides well into turning. With a GB code the same word lands in Basildon, and the nearest camera, 10.7 km off, is a live stream of free-range turkeys in a wood at Woodham Ferrers: a few birds sitting about in the leaf litter under bare trunks, a 30-second stream, stamped 14:14:49 as I watched it. Ten weeks before Christmas that camera carries a dramatic tension the Rhode Island one lacks.

The country code is part of the cache key too, which matters more than it sounds. Cache the answer to "wickford" without it and the first searcher of the day decides which hemisphere everybody else gets.

The ʻokina, folded on 2026-10-08

The other half of finding a place is spelling it. Nobody types the macron in Kīlauea or the ʻokina in Halemaʻumaʻu, and when we went looking at the start of this month a search for "kilauea" was matching 2 of the 17 Kīlauea cameras we held, because the stored search text kept the accented spelling whilst the query cleaner deleted accented letters outright instead of folding them.

Since 2026-10-08 each camera stores three spellings: the original, an accent-folded version with apostrophes removed, and a second fold with apostrophes turned into spaces. That last one is for the ʻokina, and it happens to fix English possessives, which fold the same way. Every search asks for the original form or the folded one, so a reader typing plain ASCII and a reader pasting the name off a USGS page arrive at the same cameras. "Kilauea" at 13:14 UTC today returned five, all by text with no geography needed, among them the Halemaʻumaʻu south view and the camera on Uēkahuna bluff that looks across the caldera from the overlook railing.

One detail of that change is worth stealing if you build the same thing. The search text is maintained by a database trigger that fires when a camera's name, city, state or country changes, so redefining the text touches no existing row at all. The new folds only reached the live fleet because a backfill script walked every camera in it. A definition change that silently applies to nothing is a nasty class of bug, and the fix is a backfill you have to remember to run.

What we log about it

Every search writes a row recording which of four things happened: text was enough, text was supplemented by geography, geography did all the work, or nothing came back. Keeping those four apart is the point. Collapse them and every rescued search still counts as a miss, and the list of queries that found nothing, which is the most useful list we have for deciding what to go and collect next, fills up with searches that worked.

We are going to put the rescue rate on the trends panel next to the raw search count, with ninety days behind it. Of the 44 searches on 2026-10-13, 2 came back empty, and a single pair of days is not worth reading anything into, which is rather the argument for the chart.

The open question is what to do with a query that geocodes beautifully to somewhere we have nothing at all. "Elephant butte" resolves to the right reservoir in Sierra County, and the nearest live camera to it is 69.6 km away on a shrubland research range. Returning that is not wrong, exactly, but a camera 70 km from the thing you asked about is not an answer either, and I have no principled distance at which we should stop and say so instead. It probably varies by how empty the country is. If you have seen a directory handle that well, I would like to see it.

Corrections to [email protected].