Gunboats patrolling the Hudson River. Unannounced street closures in Manhattan. Contingency plans by the NYPD in case demonstrations spill out of police pens.

About 1,000 city cops are assigned to President Donald Trump’s first homecoming since the native New Yorker’s inauguration Jan. 20, according to an NYPD official. Trump will be visiting the Intrepid Sea, Air & Space Museum on Thursday, a commemoration of 75 years since a pivotal World War II naval conflict in which U.S. and Australian forces beat back Japanese counterparts.

Because the Intrepid is anchored in the Hudson, surrounded by water on three sides, fewer street closures and few if any subway detours are expected than for past presidential visits, which are usually to denser parts of the city, the official said.

Although more protesters are expected for this presidential visit, the Intrepid’s location eases the burden on city resources, with more available open spaces and fewer affected cross streets.

The NYPD is preparing protest pens, north and south of the Intrepid site at Pier 86 at West 46th Street and 12th Avenue, as well as near Trump Tower on Fifth Avenue between 56th and 57th streets, the official said.

Riot and disorder-control officers are positioned in case protests turn violent, along with buses or vans to take arrestees to designated off-site detention sites.

“You always have to be prepared for the possibility that it may get out of hand in terms of violence,” the NYPD official said, adding: “We gotta prepare for, what if we need to make mass arrests, how do we do it?”

advertisement | advertise on newsday

The NYPD official spoke on condition of anonymity so as not to antagonize the U.S. Secret Service.

Depending on crowd size and the tenor of protests, police supervisors on site will decide “ad hoc” whether to let demonstrations spill onto the street.

The NYPD’s chief of patrol, Terence Monahan, and chief of Manhattan South, William Morris, will oversee the operation, expected to include about 1,000 officers: some with assault rifles, others controlling traffic, monitoring protesters, patrolling on bicycles and being part of the presidential motorcades. Sand-filled trucks are to be positioned perpendicular to cross streets to prevent a driver from ramming the area with explosives.

The NYPD said in a statement to expect “temporary” closures near the Intrepid and Trump Tower, but declined to be specific.

To prevent a suicide attack like al-Qaida’s in 2000 on USS Cole in Yemen — which killed 17 sailors — the U.S. Coast Guard and NYPD will patrol the Hudson River and restrict boat traffic, a former U.S. Secret Service director told Newsday.

“You don’t want to have an incident where some boat is able to drive right up on it . . . filled up with some type of explosive, like the Cole,” said the former director, who spoke on condition of anonymity because the agency asked former officials not to talk to the media. “You don’t want to give people that opportunity.”

In advance of Trump’s visit, Secret Service personnel have probably been scouring social media such as Twitter and Facebook to identify people who could be threats, the former director said.

“You want to respect people’s right to protest. That’s their right,” the former director said, adding: “At the same time you want to make sure that all that they’re looking to do is to demonstrate. You have to worry is there one wild card in there that could create a problem.”