TONDER, Denmark — Trying to halt the spread of a disease that can wipe out domestic pig populations, Denmark intends to build a fence along its border with Germany to keep out the pigs’ wild cousins. There are just a few wrinkles to the plan.

To the government’s frustration, many Danes see the fence as being about more than just swine. Depending on their backgrounds and political stripes, people have called it a possible step toward blocking refugees, a detriment to wildlife, a reminder of painful history, or a violation of the European Union ethos of invisible borders and free movement.

Oh, and there is little scientific evidence to suggest that it will work.

“We have to enter the imagination of a pig,” said Bent Rasmussen, the chief forest manager for the area, who is in charge of the project. “It’s not easy.”

The African swine fever virus poses a serious threat to production of pork, a major export for Denmark. It spreads readily and is highly resilient, capable of surviving for months in pork products and feces. There is no vaccine or treatment, and the only way to contain an outbreak is to cull the population, as Romania did recently, killing 230,000 pigs.