In 2010, the U.S. Census Bureau came up against Pennsylvania’s often confusing boundaries for local governments. And at the border of Chester and Delaware Counties, the census got it wrong.

Census Bureau officials, responsible for the comprehensive decennial counting of the nation’s population, determined later that they had incorrectly counted some residents of Thornbury Township, Chester County, as living in a neighboring Delaware County township of the same name.

Through a program that allows jurisdictions to challenge Census Bureau population counts, the agency gave back 246 residents to the Chester County municipality, which bumped its population up to 3,263.

Communities across the country have been working for months or even years to make sure all their residents get counted in the 2020 Census. The results of the census will determine the distribution of hundreds of billions of dollars in federal funding to states and local governments for the next decade, as well as the boundaries of congressional and state legislative districts.

But if state or local officials have reason to think the Census Bureau miscounted after it releases local population totals in 2021, they can ask the bureau to check again, under certain circumstances.

One way to challenge the numbers is to prove that the bureau incorrectly classified housing units as vacant through records such as water meter readings, building permits, tax rolls, and school enrollment records. Governments also have been able to show that the bureau used incorrect maps. This time, because of technological advances, errors in locating populations — such as what happened in the Thornbury Townships in 2010 — are less likely.

Government officials don’t often challenge counts, said Terri Ann Lowenthal, a former staff director of a U.S. House Census Oversight Subcommittee who now works as a census consultant for cities. More than 230 local governments challenged their population totals from the 2010 Census.

“The most important goal is to get it right the first time because the challenge process is time-consuming and does not affect the final data for all purposes,” Lowenthal said. Although the federal government can use corrected numbers for distributing funds, the changes come too late to alter the data used for redrawing voting district boundaries and distributing seats in the U.S. House.

Census workers don’t physically go back out to count residents. “There are no do-overs with the census,” Lowenthal said.

Local officials also have to be careful about challenging the bureau. Sometimes, it revises population counts downward because of its subsequent research, as in Haverford Township, Delaware County. The township lost seven people from its original 2010 Census count.

New York City challenged its 2010 Census population count after it fell short of the city’s estimate. New York argued that the bureau had overcounted the number of vacant housing units in southern Brooklyn and northwest Queens, missing residents in the process. The bureau didn’t end up revising the city’s population.

But challenges to Census Bureau counts can be worth the effort if a municipality gets a major revision upward. Philadelphia was one of 39 municipalities — including Boston, St. Louis, and San Diego, Calif. — that successfully challenged the bureau’s 2008 estimate of its population, a separate process from challenging the decennial counts. Philadelphia’s revised population count of 1.54 million was almost 93,000 people more than the original count.

Given the money and political power at stake in the 2020 Census, states and cities are pouring millions of dollars into making sure all their residents are counted the first time. Officials in Philadelphia started preparing for the 2020 Census nine months earlier than they did for 2010.

The work of Philadelphia officials and others throughout the country will continue through the first batch of nationwide mailings the Census Bureau will send in March, the reminder mailings that follow, and, starting in May, the visits by census workers to residents who have not filled out their questionnaires.

But they’re also ready to challenge the census figures if necessary.

“Right now, we’re focusing all our energy on preventing an undercount,” said Stephanie Reid, director of Philly Counts 2020, the city’s census effort. “But we are prepared to cross that bridge if we get there.”