Gasoline costs more in communities throughout the Buffalo Niagara region than it does in roughly four out of every five towns and cities across the United States and Canada, a new survey found.

A ranking of gasoline prices in nearly 5,600 communities by found that a gallon of gas costs between $3.80 and $3.88 per gallon in the 15 communities across the Buffalo Niagara region that were included in the survey.

The most expensive gas was in North Tonawanda, where the average price per gallon at the 10 stations included in the survey was $3.879 per gallon. That ranked North Tonawanda as the 969th most expensive market for gasoline among the 5,597 municipalities included in the ranking.

Lockport had the best ranking among cities in the Buffalo Niagara region, with its average price of $3.80 per gallon coming in as the 1,276th most expensive market in the country. Or to look at it another way, gas was cheaper in 4,322 U.S. markets than it was in Lockport on Aug. 8, the day the survey was conducted.

No one has a clear explanation why gas is so expensive in Western New York. Local industry insiders have suggested a combination of factors, including the cost of transporting gasoline products the longest distance in the state, poor access to refineries, the role of direct marketers in setting prices and the high county sales taxes in the region – 4 percent in Niagara County and 4¾ percent in Erie County, tied with Oneida County at the highest in the state.

In Rochester, the price was $3.81 a gallon; and in Syracuse it was $3.78.

The survey found a wide range in gasoline prices across the U.S. and Canada. The cheapest gas was in Danville, Va., a rural town just north of the North Carolina border, where gas cost $3.09 a gallon.

The most expensive place to buy gas was Delta, British Columbia, where a gallon cost $5.30. Each of the 294 Canadian towns and cities in the survey had more expensive gas than the Buffalo Niagara region. The lowest gas price in Canada was in Spruce Grove, Alberta, where a gallon cost $4.04.

In the United States, the most expensive gas is found in Needles, Calif., where a gallon cost $4.79. All of the other U.S. markets in the top 10 for the most expensive gas were in Hawaii.

The most expensive U.S. gas outside Hawaii and California was in the New York City suburb of Mount Kisco, where a gallon costs an average of $4.34.

The cheapest communities to buy gas in the United States generally were in South Carolina and Virginia, the survey found.