Officials in cities across the United States and Canada are staying in close touch with San Francisco planners. “People often wait to see what California does” about environmental hazards, said Gary B. Griggs, a professor of earth and planetary sciences at the University of California, Santa Cruz. “So we have a chance to have a big impact.”

Locally, hundreds of millions of dollars ride on the Ocean Beach decision. The San Francisco State study projects that sea-level rise there could impose costs of more than $650 million by 2100 if nothing is done. The big-ticket items are the components of the Oceanside Water Pollution Control Plant and related structures, which were completed in 1993 to meet Environmental Protection Agency demands for cleaner wastewater.

Erosion, of course, is a perennial issue for beachfront communities, and Ocean Beach, artificially expanded more than a century ago, has always been vulnerable. But as the planet warms, the problem is expected to become far more severe all along the northern Pacific Coast. Sand bluffs in the Bay Area, which for decades have eroded by an average of more than a foot a year, are expected to collapse at an ever-faster clip.

The options are to keep installing hard structures in front of vulnerable areas, replenish the sand or simply retreat and let the shoreline move where it will.

Each has a cost. Building walls or piling up riprap protects infrastructure. But it amplifies wave action as water ricochets off the hard surface with enough energy in its retreat to scour the sand. The scouring hastens the disappearance of bluffs and beach.

“The pros of riprap are that it can be long term,” said John R. Dingler, an oceanographer with the Army Corps of Engineers. The cons, he said, are that “there will be no beach at high tide.”

The armoring of the coastline interferes with beachgoers, infuriates environmentalists and surfers and disturbs vegetation and bird habitats. But after destructive storms, it has been San Francisco’s solution of choice in recent years, with city bulldozers dumping thousands of tons of rock and chunks of concrete, granite and brick sidewalks into new breaches.