Despite a summer short on rain, state data showed attendance at Long Island state parks, historic sites and campgrounds edged up just 2 percent, to 12.5 million.

That contrasts with the almost 18 percent gain seen in the 2015 summer, which the National Weather Service said had about two more inches of rain.

Randy Simons, spokesman for the Office of Parks, Recreation and Historic Preservation, said many factors, not just weather, determine how many people enjoy the outdoors.

“There are many variables that factor into attendance fluctuation each year such as weather, length of season, economy, special events, etc.,” he said by email.

This summer was one week shorter than last year and ocean swimming was banned over Labor Day weekend due to Tropical Storm Hermine, he said.

“That certainly put a crimp in Labor Day attendance along our ocean beach parks but safety is always the highest priority.”

advertisement | advertise on newsday

Attendance at all state parks showed a similar pattern.

This summer, only 120,000 more people visited them than in 2015, firming the latest total to just under 38.4 million, Gov. Andrew M. Cuomo said.

“This administration has made an unprecedented investment in our state park system, bringing new facilities, new energy and — as these numbers show — increased attendance during the summer season,” he said in a statement.

Wantagh’s Jones Beach State Park remained the most popular Island park, with 3.8 million people, down from 4.1 million.

Imperfect weather for the July Fourth fireworks might have compressed attendance, officials said.

At nearby Robert Moses State Park, attendance rose to almost 2.5 million, from 2.4 million.

Robert Moses tends to attract locals, who “go down just to spend a little time during the hot, hazy weather, versus Jones Beach, which is more of a metropolitan crowd — they tend to stay in their air conditioning,” said George Gorman, Long Island deputy regional director of the parks department.

The third most popular park, Sunken Meadow, was visited by 1.76 million people, up from 1.4 million in 2015.

Its new bathhouse and golf course “absolutely made an impact,” Gorman said.

Sunken Meadow’s leap also revealed the superior accuracy of its new automatic car counters over previous estimates based on periodically tallying up parked cars, Gorman said. And the agency’s estimates often are quite conservative.

advertisement | advertise on newsday

New car counters also pushed up visitation numbers at Montauk Point, up more than 52 percent, and nearby Hither Hills State Park, up almost 39 percent.

“This is going to happen over the next several years; I’m getting car counters everywhere,” Gorman said.

On a percentage basis, Montauk’s Camp Hero State Park scored the biggest gain, nearly 63 percent, partly because it has become a popular spot to get married.

Eleven parks drew fewer visitors, including Planting Fields Arboretum State Historic Park in Oyster Bay and Bayard Cutting Arboretum in Great River.

“When it’s so hot, people don’t go to arboretums to walk around the grounds,” Gorman said.

advertisement | advertise on newsday

At Orient Beach State Park, the numbers were down mainly because it recalculated its estimates.