NEW YORK — This is a three-dimensional city — and one that constantly reminds us of that fact. From my mid-rise apartment, in a neighborhood well into the Brooklyn sticks known as Ditmas Park, I have a clear view of Manhattan’s postcard skyscrapers on the horizon at night. As one of this city’s 8.6 million residents, I tend to navigate these three dimensions in a series of gray metal boxes. For my horizontal transportation, save the odd late-night taxi, I ride the subway. For my vertical transit, I ride in elevators.

In 1857, still years before the Civil War, the world’s first commercial passenger elevator was installed in New York, in the Haughwout Building, then a five-story department store, at the corner of Broadway and Broome Street in SoHo. The original Haughwout elevator is long gone, but the elevator ignited what The New York Times called a “tall-building revolution,” quite literally shaping the city as we know it. And now the things are everywhere. And they’re remarkably safe: There are only about 30 elevator and escalator deaths in this country each year. About 1,900 people die taking the stairs.

About 150 years after the first elevator, a database of every elevator in New York City appeared on GitHub. The city’s Department of Buildings released it after a Freedom of Information Law request from Noah Veltman, a developer and reporter on the data news team of WNYC, the city’s public radio station. Veltman was good enough to release it to the broader public. When I dug into it, it revealed a city that’s defined as much by its verticality as it is by its pizza.

“Elevators really do determine, in multiple ways, how tall a building will be and what our skyline looks like,” Carol Willis, the founder and director of the Skyscraper Museum in New York, told me.

TYPE COUNT Passenger elevator 66,602 Freight elevator 4,140 Escalator 2,663 Dumbwaiter 1,143 Sidewalk elevator 943 Private elevator 252 Handicap lift 227 Manlift 73 Public elevator 45 Elevator devices in New York City Source: New York City Department of Buildings

As of 2015, there were more than 76,000 elevator devices in New York — basically anything that moves people up and down. The average listed capacity of these is about 2,750 pounds, which means that approximately 18 percent of the city’s adult population could be safely suspended in mechanical elevation or descension at any given moment, if they were so moved. There are many more miles of elevator shafts (about 1,570, assuming a reasonable average floor height, etc.) than there are miles of subway tracks (about 840).

Everybody in New York seems to have an elevator story. My colleague Clare Malone once had to be cut out of one by the Fire Department. My ex-girlfriend had to be pried out of one by a good Samaritan. I, having somewhat better elevator luck (knock on wood), once rode one with Adam Sandler. The excellent, New York-set TV show “Louie” aired a six-part suite of episodes in 2014 that were each called, simply, “Elevator.”

Elevators are ubiquitous in New York, and so entwined with how the city functions, that merely plotting their latitudes and longitudes yields a fairly serviceable map of the city (except for Staten Island, which as usual gets the shaft ). After plotting elevator devices alone, you can still make out parks, cemeteries, major thoroughfares, commercial centers, inhabited East River islands and borough boundaries.

It should be noted briefly here that this data set, while big and nice and public and free, teaches valuable lessons in empirical caution. For whatever reason, the very official-looking data from the very authoritative-sounding Department of Buildings contains errors. A building on 18th Street, it claims, has an elevator that goes up to the 912th floor, more than five times the highest floor in the tallest building in the world. It would soar more than 1.5 miles up into the sky. Another, on the Avenue of the Americas, is said to go about 80 mph — but the world’s fastest elevators go less than 40. One passenger elevator in Queens claims a maximum capacity of just 2.5 pounds, or about four subway rats.

But onward we press — minding our step as we do.

Some of the outlying entries in the data set are indeed legitimate. The Barclays Center, home to the Brooklyn Nets and New York Islanders, has not one but two freight elevators that each have a capacity of 80,000 pounds (13 or so elephants). And an elevator at the Empire State Building does indeed go to the 102nd floor.

But most New York elevators, my own apartment building’s included, are far more mundane and top out at the sixth floor. The six-story building is the staple of New York housing stock. There are good reasons for this, one of which is geological. Nearly all New York City’s drinking water flows down from reservoirs and through aqueducts from upstate without any pumping — gravity does the work. A building taller than six stories requires a water tower and its own pumps to provide suitable water pressure to tenants on the higher floors, and that’s a costly pain in the neck to build and maintain. Also, new buildings five stories or taller at least since 1968 have been generally required by the city to have an elevator, although some five-story buildings are exempt. So six floors is tall enough to need an elevator but short enough to avoid needing a water tower and other extra construction expense.

“Elevators are really the most important factor in determining the economic height of the building,” Willis said. People don’t like to climb dozens of flights of stairs. Elevators allow one to build higher — and better, faster, more efficient elevators higher still.

ZIP CODE NEIGHBORHOOD ELEVATORS 10021 Upper East Side 3,132 10019 Hell’s Kitchen 2,600 10022 Midtown East 2,555 10001 Chelsea 2,294 10017 Midtown East 2,175 The 2,000-elevator club Source: New York City Department of Buildings

The elevator made its public debut in SoHo, but of course has spread to every corner of the city by now. The majority (57 percent) are in Manhattan. Brooklyn claims 18 percent of them, Queens 13 percent and the Bronx 10. Five Manhattan ZIP codes, nearly all in or around Midtown, are members of the elite 2,000-elevator club.

Elevator technology is still evolving, and engineers have always had to deal with riders’ fears and expectations to convince them the devices are worth riding. “The main thing was to assure people that they wouldn’t plummet to their deaths,” Willis said about early elevators. The Otis elevator in the Haughwout building emphasized this with an automatic safety device. Nowadays, the trick is convincing people that they won’t need to wait more than 30 seconds to ascend. Innovations like elevator banks and destination dispatch have worked to accomplish that.

On the whole, though, the elevator is an unquestionable success story. Citywide, elevators are taken on something like 4 million rides on the average day. And now, thanks to the data revolution, we have a bird’s eye view of their place in the city. Maybe Willy Wonka’s Great Glass Elevator exists, after all — and maybe it’s called data. Grandpa, our town looks so pretty from up here.