On an early weekend morning in December, a single truck will trek down San Francisco's storied Market Street in the dark. From the Ferry Building—stolid survivor of the city's 1906 and 1989 earthquakes—all the way to one of the few remaining brick-paved blocks near Octavia Boulevard, and then back. And then again. It'll drive the route four times, each time peppering the city's facades with millions of laser beams.

The goal? To create a perfect, three-dimensional map of the boulevard—just in time to completely redesign it.

Typically, stories about LiDAR—the technical term for those showers of lasers—talk about how scientists use it to map shifts in topography after natural disasters or the disappearance of the world's carbon-consuming forests. Mount a LiDAR system on a plane, and it can return strikingly detailed plots that would have taken weeks and dozens of people to collect with traditional surveys.

But on the top of a truck, that same system turns into a powerful tool for city planning. In San Francisco's case, urban designers would like to build Market Street into something more than a transit spine. Plodding along a 2.2-mile stretch of the street at a steady 5 miles per hour, a roof-mounted system called the Riegl VMX-250 will bounce lasers off surfaces and sense those beams as they return, building a 3-D point cloud of the truck's surroundings.

San Francisco Public Works

The slower the truck goes, the more chances it has to capture every surface—from the overhead wires that power the city's electric buses to fire hydrants and painted parking lines. Accuracy also goes up with repeated scans, so the truck will take four trips on a mostly-unpopulated street, traveling with and against the flow of traffic two times each. With the final point cloud, the city will have a perfect representation of 2015-era Market Street, according to Simon Bertrang, project manager for the Better Market Street project. "Our city employee surveyors will draw that up in AutoCAD," he says, to use as a baseline for improvements to the main transit route.

San Francisco isn't the only city painting a self-portrait with lasers. Earlier this year, in the wake of destructive rioting, Baltimore used LiDAR to map its streets and assess the damage. Other cities and companies are using it more proactively, keeping tabs on long-neglected infrastructure. "Some of these utility companies don't know how many street lights they have," says Orlando Saez, CEO of the street-scanning company CityScan, which uses both LiDAR and photogrammetry to document street-level details.

Two years ago, CityScan worked with Philadelphia to—don't laugh—count the city's billboards. It seems simple enough, but think about how long it would take a single person to do that job. Hiring CityScan to drive the city's perimeter of expressways was much faster, and found the city was missing opportunities to monetize the spaces. CityScan also worked to help the city identify abandoned buildings based on algorithmic analysis of its scans, training a program to look for features like debris and collapsed wood—facial analysis software for buildings.

Google's StreetView cars have included LiDAR scans for some time, too. But the company's efforts seem focused on ground-level data—things like curbs and street lines, the sort of stuff mostly of interest to self-driving cars. San Francisco wants a greater level of detail, which is why it's driving so slowly and making multiple passes. By measuring the intensity of the reflected laser beams in addition to their orientation, the system will even be able to capture textural differences, like painted bike lanes.

Of course, even that level of detail doesn't mean the project will go off without a hitch. San Francisco originally planned to do the LiDAR scan this past weekend, but it ran into a challenge that no one in California has dealt with in quite a while: rain. "When it gets damp, you can't see anything," says Neil King, the project's surveyor. Lasers bounce off of rain drops instead of their intended targets on the street, and "the data becomes holey, spotty." Even high-tech has its failings.