But most of the warnings and a requirement in a 1978 law to create a regularly updated plan for the restoration of "vital services" after a storm went mostly unheeded, either because of tight budgets or the lack of political will to prepare for a hypothetical storm that may never hit.
Some of the thorniest problems after Sandy, including a gasoline shortage, the lack of temporary housing and the flooding of commuter tunnels, ended up being dealt with largely on the fly.
"I don't know that anyone believed," acknowledged Gov. Andrew Cuomo this past week. "We had never seen a storm like this. So it is very hard to anticipate something that you have never experienced."
Asked how well prepared state officials were for Sandy, Cuomo said, "not well enough."
It wasn't as if the legislative actions over the years were subtle. They all had a common, emphatic theme: Act immediately before it's too late.
The 1978 executive law required a standing state Disaster Preparedness Commission to meet at least twice a year to create and update disaster plans. It mandated the state to address temporary housing needs after a disaster, create a detailed plan to restore services, maintain sewage treatment, prevent fires, assure generators "sufficient to supply" nursing homes and other health facilities, and "protect and assure uninterrupted delivery of services, medicines, water, food, energy and fuel."
Reports in 2005, 2006 and 2010 added urgency. "It's not a question of whether a strong hurricane will hit New York City," the 2006 Assembly report warned. "It's just a question of when."
A 2010 task force report to the Legislature concluded: "The combination of rising sea level, continuing climate change, and more development in high-risk areas has raised the level of New York's vulnerability to coast storms. ... The challenge is real, and sea level rise will progress regardless of New York's response."
The Disaster Preparedness Commission met biannually some years, but there are gaps in which there is no record of a meeting. However, some administrations, including Cuomo's, convened many of the same agency heads to discuss emergency management. But even under Cuomo, who has taken a much greater interest in emergency management after three violent storms in his first two years in office, there are still three vacancies on the commission.
Richard Brodsky, a former New York Democratic assemblyman who was chairman of the committee that created the 2006 report, credits administrations with making some improvements to the plan in recent years, such as requiring a specific plan to protect and evacuate the infirmed and to save pets.
"But on two issues related to Sandy - prevention and recovery - they did almost nothing," Brodsky said. "If Goldman Sachs was smart enough to sandbag its building, why wasn't the MTA smart enough to sandbag the Battery Tunnel?"
Sandy flooded both tubes of the Brooklyn-Battery Tunnel, now called the Hugh L. Carey Tunnel, which was one of the major and longest transportation disruptions of the storm. It also ravaged the Rockaways in Queens, particularly the waterfront community of Breezy Point, where roughly 100 homes burned to the ground in a massive wind-swept fire.
Among the other crises Cuomo and New York City Mayor Michael Bloomberg faced on a daily basis during Sandy were the shortage of temporary housing, which continues, the long disruption of electricity and gasoline, generators in health care facilities swamped by floodwaters, restoring power from swamped electrical infrastructure and repairing commuter rail lines.
The warnings touched on many of these areas, but mostly in a broad way with few specific directions for action. Some areas, such as a shortage of shelters in New York City and repairing commuter rail lines quickly, have improved in recent years to some degree, but other areas such as making sure health facility generators are on upper floors are newly realized problems forced by Sandy, according to the former legislators.
"What you've got here is a great number of consequences that were foreseeable, but unforeseen," Brodsky said. "Prevention is politically less sexy than disaster response."
There was another obstacle to enacting calls for more preparation: funding. The state and city were each facing $1 billion deficits from a slow economic recovery before Sandy hit.
"As your budget shrinks, the first thing that goes out the door is emergency management, the first thing," said Michael Balboni, New York's disaster preparedness point man in the Republican-led Senate and in the Democratic Spitzer and Paterson administrations from 2001 to 2009.
"To take the 1978 law and really enable it, you need to put a ton of money behind it and there was no political will to do it," said Balboni, who now heads an emergency management firm in Manhattan.
Cuomo is now asking the federal government for more than $32 billion to cover the immediate costs triggered by Sandy, and an additional $9 billion for preventive measures to better protect the area for the next big storm.
The Cuomo administration insists that it has had robust emergency planning and clearly made important changes after tropical storms Irene and Lee slammed much of upstate and threw a scare into New York City in 2011. The administration created three regional disaster logistics centers and conducted training and exercises and, before Sandy, took extensive preparatory steps learned from Irene to "preposition" equipment and top staff and National Guard troops around the state.
"These initiatives were intended to strengthen the existing emergency response infrastructure which had not previously been a priority for the state before Gov. Cuomo took office," the administration told the AP in a statement.
Spokesmen for previous administrations and for Bloomberg didn't respond to requests for comment.
Like the state, the city has talked up storm preparedness in a series of hurricane and climate change plans since 2000. And it has taken some concrete steps, such as requiring some new developments in flood zones to be elevated, eliminating roadblocks to putting boilers and electrical equipment above the ground and restoring wetlands as natural storm-surge barriers.
Still, the city wasn't expecting Sandy, Bloomberg said in a speech this past week. The Federal Emergency Management Agency had figured there was only a 1 percent chance that the Battery in lower Manhattan would see the 14 feet of water Sandy sent in, he said; the previous record, set in 1960, was 11 feet.
Bloomberg said the city would reassess building codes and evacuation zone borders, look at ways to flood-proof power and transportation networks, make sure hospitals are better prepared and do an engineering analysis of whether to build levees, dunes or other structures to protect the coast.