West Marin ranchers are anxiously watching a pitched battle unfold over the county line, where animal rights activists are pushing a first-in-the-nation ballot measure aimed at limiting the size of Sonoma dairies, ranches and poultry farms.

Supporters of Measure J gathered more than 37,000 signatures in March to get the measure on the ballot, but every local government in the county has since passed a resolution opposing it. It’s hard to drive along a Sonoma County road without seeing a yard sign or a billboard promoting the measure or assailing it.

In West Marin, the signs that have sprouted on major ranches and dairies take just one side in the debate: “No on J. Protect local food.” 

Here, cattle and dairy ranchers fear that the measure’s supporters, whom they cast as vegan extremists, might target them next if they succeed in Sonoma, shutting down family farms that have been operating for generations.

By itself, the Sonoma measure would have spillover effects in Marin, they argue, as the two counties form an interconnected farm economy that would feel the impact of any shutdown. 

“When it comes to farming and ranching in Marin and Sonoma County, we don’t really have county lines,” said Dayna Ghirardelli, the president of the Sonoma County Farm Bureau. “We’re a two-county region, and we rely on one another for resources.”

Andy Naja-Riese, executive director of the Agricultural Institute of Marin, which operates nine farmers markets in the county, said the impacts would be widespread.

“There’s going to be a domino effect,” he said. “This is going to impact feed stores, farm equipment businesses, trucking companies, food businesses and restaurants that purchase from these local farms. We think it’s really going to impact the entire local food supply.”

While wine grapes are Sonoma’s largest agricultural crop, livestock and poultry products generated over $100 million in revenue last year, according to the Sonoma County Crop Report. In Marin, livestock and poultry products generated $59 million.

Measure J would target farms with 700 cows or more and poultry operations with between 37,500 and 120,000 birds, depending on how they dispose of waste. The measure’s proponents say it would directly affect around 21 Sonoma County farms, including a half-dozen dairies. It is aimed primarily at large egg and poultry businesses. 

Proponents of Measure J argue that eliminating what they call factory farms would protect animals, the environment and public health. They say the measure would not impact the vast majority of Sonoma’s farms, most of which are small or medium-sized operations. 

The measure was written by the Coalition to End Factory Farming, a collection of animal welfare advocates, environmentalists and small producers. It would phase out larger farming operations known as Concentrated Animal Feeding Operations, or CAFOs, which advocates of the measure refer to as factory farms. The measure uses an Environmental Protection Agency definition of a CAFO, where animals are confined indoors for at least 45 days a year. The E.P.A. monitors CAFOs to ensure that they don’t contaminate nearby water supplies.

Opponents of Measure J say it would shut down generational ranches and dairies that follow best practices and bear no resemblance to the massive cattle operations in the Central Valley or the Midwest, where a single farm often has 5,000 heads of cattle.

Between three and five West Marin ranches and dairies might meet the 700-cow threshold set in Measure J, according to Scott Wise, assistant commissioner with Marin’s Department of Agriculture and Weights and Measures. “It’s hard to know for certain because we don’t know exact confinement numbers, and herd sizes increase and decrease year by year depending on economic and environmental factors,” he said.

Cassie King, an organizer with the Coalition to End Factory Farming, acknowledged that the group aspires to expand its efforts beyond Sonoma County, although it has no immediate plans to target Marin.  “I think that there is a huge opportunity here to change the food system nationally, and this is one steppingstone in that path,” she said.

Sonoma County’s agriculture operations, like Marin’s, are generally known for their devotion to sustainable, organic farming. But proponents of Measure J view the largest of them as sinister places befouling the environment and torturing animals.

“What I’ve seen at Sonoma County factory farms has been among the worst things I’ve ever seen,” said Lewis Bernier, an animal rights activist who has documented inhumane treatment at several farms across the country. He described 200,000 birds crammed together at one Sonoma County farm, spending their entire lives on wire floors, often flipping onto their backs and catching their feet and wings in the wires. 

“They are unable to flip themselves back over and as a result are unable to access food and water,” he said.

Opponents of Measure J view its proponents as outside agitators. Some of the measure’s main promoters have ties to the Berkeley chapter of a group called Direct Action Everywhere, which describes itself as a “global network of activists working to achieve revolutionary social and political change for animals in one generation.”

The group’s members held large protests at Sunrise Farms and Reichardt Duck Farm in 2018 and 2019 and removed chickens and ducks they alleged were mistreated. Wayne Hsiung, a co-founder of Direct Action Everywhere, was sentenced to 90 days in jail and two years of probation for felony trespassing in connection with the first protest.

Mr. Naja-Riese described Measure J’s proponents as extremists. “My belief is that the groups that are organizing this are trying to eliminate animal agriculture,” he said. 

Supporters of the measure say that CAFOs are polluting waterways around the county, including one that drains into the Walker Creek watershed and Tomales Bay. “The amount of waste they create is massive, and it’s also extremely noxious,” Mr. Bernier said. “Every waterway adjacent to one of these large dairy CAFOs is impaired with contaminants that are heavily associated with CAFO pollution.”

Mr. Bernier said waste associated with CAFOs is also a major contributor to greenhouse-gas emissions. “Scaling down the size of some of these very large farms would have major benefits for the environment,” he said.

But opponents argue that shutting down local farms would have environmental impacts as well, if consumers shift to products trucked in from afar.

“The farms here are doing incredible work,” Mr. Naja-Riese said. “Sonoma and Marin are some of the best organic, pasture-based operations anywhere. It’s not clear what the problem is that this ordinance is trying to solve.”

Sally Gale, who operates a Chileno Valley cattle ranch, said Measure J is yet another sign that attitudes toward agriculture are shifting in the region. Environmental groups have filed lawsuits to shut down commercial agriculture in the Point Reyes National Seashore, and the Marin County Civil Grand Jury recently conducted investigations besmirching the Marin Agricultural Land Trust and the Marin Resource Conservation District, both of which support local farmers.

“I see why some of the ranchers are feeling paranoid, because it really does feel like we’re being targeted,” said Ms. Gale, who chairs the Marin R.C.D. board and has planted a No on Measure J sign at her ranch.

Not far away, Stephanie Moreda worries about the impact that Measure J could have on her family ranch, which straddles Sonoma and Marin Counties. She’s a fifth-generation farmer, and she hopes her kids will become part of the sixth.

“We have just about 700 cows milking here, which is small,” she said. “The national average is 3,000. They are alleging that a farm like ours—which is organic, pasture-based, environmentally certified, animal-rights certified, family-owned—is a factory farm. It just doesn’t make any sense.”