New Jersey's coastline has been whacked.

Entire beaches are gone - some swept into the towns that once bordered them.

However, early indications are that areas with beach replenishment and dunes were spared the worst damage.

"In fact, the dunes worked - in Avalon, North Wildwood, Stone Harbor," said Stewart Farrell, director of the Richard Stockton Coastal Research Center, which has been studying New Jersey's shore for 26 years.

He found that on Long Beach Island, where dunes were built - in Harvey Cedars, Ship Bottom, and Surf City - damage was less.

"It was absolutely, painfully obvious," he said. "Where the dunes were wider and higher, no damage from the waves. Where they were low and thin and narrow, wipeout time."

These mini-mountains of sand - stuff fine enough to be shoveled by a toddler, but when piled high, able to withstand storms - are also a bane of some homeowners.

Opponents often cite a loss of ocean views, ocean breezes, ocean ambience. They also fear increased public use of "their" beach.

At a time when sea-level rise could reach three feet by the end of the century, and projections call for storms to increase in both number and intensity, the battle of the beaches - how long can we keep this up, and who pays? - can only escalate.

According to the U.S. Army Corps of Engineers, more than $700 million has gone into pumping, dumping, and otherwise replacing sand on nearly 54 developed miles of the Jersey Shore since 1986.

An average of nearly five cubic yards of sand have landed on each foot of beachfront, an analysis by Stockton's research center found.

The impact - notable on barrier islands, which are known to retreat landward - has been an average creep seaward of about four feet.

And the cost keeps rising. Storms get ever more expensive because more people and buildings are in the way.

The Jersey coast now is lined with about $100 billion worth of real estate. In 1962, the year of the Ash Wednesday storm, that figure was $1.2 billion.

Assuming a future scenario with more storms and worse ones, replenishment will have to happen more often.

It's too early to tally Hurricane Sandy's devastation.

"We are still in damage-assessment mode," said army corps spokesman Stephen Rochette.

One indelible image: Uncountable tons of sand are now caked so thickly on the macadam and pavement of the 50-mile-long Ocean Drive - a series of roadways and bridges that connect the Shore's barrier islands from Atlantic City to Cape May - they may want to rename the fabled roadway Sandy Drive.

There's so much sand that the state Department of Environmental Protection, which used to frown on towns shoving storm-tossed sand back onto the beaches, fearing it had been contaminated by motor oil and other pollutants, has relaxed its stance.

Now, beach towns are being told they can put the sand back where they need it.

To help with damage assessments - both by officials and anxious homeowners who have been unable to get to the shore yet - the National Oceanic and Atmospheric Agency has posted thousands of coastal photos, spliced together into a mosaic of the coast. (http://storms.ngs.noaa.gov/storms/sandy/)

The resolution won't show dangling shutters, but it shows if the house is crooked on the foundation. Or if it has been washed down the street.

Vanishing sand has been a source of anxiety along developed shorefronts for decades. Erosion studies in the 1920s led to the creation of the nation's first coastal lobbying group, the American Shore and Beach Preservation Association.

It successfully persuaded Congress to deploy the Corps in the battle of erosion on the ground that beaches attracted out-of-state visitors and were a national concern.

With an act of Congress, a branch of the military that swept the beaches of Normandy for minefields during the D-Day invasion was enlisted to save U.S. beaches.

More than 90 percent of all federal shore-protection projects since 1922 have occurred in the last 50 years, according to Western Carolina University researcher Andrew S. Coburn.

But not without dissent. Many residents have fought dune projects vigorously, as in the case of former Pennsylvania State Sen. Vincent J. Fumo, who opposed building a dune in front of his Margate home.

Except for the guy who called out during a visit from Gov. Christie and President Obama - "I think, Governor, we need to level the whole neighborhood, give everybody a check, and get out of here" - no one is seriously questioning whether to restore the Jersey Shore.

"We will rebuild," Christie promised after he surveyed the damage, noting that two-thirds of the beaches he visited were simply gone.

"We may not put a house every place there was before," Christie added Friday. "Can we rebuild the beach enough to make it feasible to enter? I'll tell you that tourism is a $38 billion industry. I'd be happy to have that debate with anybody."

Yet successive White House administrations have balked at funding beach-restoration projects. Environmentalists hold that they benefit wealthy property owners, that erosion is never a problem until a building gets in the way, and that beach-fill in the long run will not withstand rising seas.

Tourism officials and coastal governments counter that beaches are essential to the nation's economy and that given the level of coastal development, retreat from the waterfront is out of the question.

"The Shore is an economic engine. It drives our $38 billion tourism economy," said DEP spokesman Larry Hajna. "People's lives and livelihoods are entwined with our shore."

Compare the billions each year generated by the Shore to the $700 million in beach replenishment - which averages $27 million a year - and guess which wins.

On average, federal expenditures for Army Corps beachfill projects are about $100 million a year. However, for the last fiscal year they were $78 million, said Howard Marlowe, the nation's leading coastal lobbyist.

New Jersey typically consumes an outsize share of the beach money. For fiscal 2012, for example, $28 million - 36 percent of the national total - was appropriated for the Garden State.

And still, the sand keeps moving and the storms keep coming.

A 2000 study by the Federal Emergency Management Agency predicted that more than 85,000 U.S. coastal properties could fall into the drink by 2060.

Eventually, the question will become "who is going to pay for the replenishment when the coffers come up empty?" said Kenneth G. Miller, a Rutgers University geology professor who teaches a class about sea-level rise and the Jersey Shore.

Where the question gets even more complicated is in communities that fight dunes.

Earlier this year, a battle over the amount that should be paid to a Harvey Cedars couple, who contended building 22-foot dunes to restore the beach in front of their home reduced its value, reached a state appeals court.

The municipality, Ocean Township, had wanted to pay them $300. A jury awarded the couple $375,000.

Several other homeowners balked as well.

But the project was built, and none too soon.

"The timing of that was apparently very good for them," Miller said. "The storm hit, and their beach had just been nourished."

And what about storm damage in communities that refuse to allow dune and beach-replenishment projects altogether?

Farrell noted that Wildwood has a wide beach, but no dunes. "So the water just rolled right across the beach into town."

A recent Stockton report on New Jersey's shoreline changes posed this question: If a massive storm should wreck properties along sections of coast where residents successfully fought a project, "will it be the duty of the U.S. taxpayer to fund the restoration of the supporting infrastructure that makes oceanfront living possible?"

The data collected by Farrell's team will undoubtedly lead researchers to tweak their designs for dunes.

"Wider and higher will do it just nicely," he said.

Contact Sandy Bauers at 215-854-5147, sbauers@phillynews.com, or follow on Twitter @sbauers. Read her blog, GreenSpace, at www.philly.com/greenspace.