If America is entrenched in an obesity epidemic, then Boulder, Colo., might as well be in another country. Set in the foothills of the Rocky Mountains, it is one of the healthiest cities in one of the healthiest states in America.

Most recently, Boulder topped the list of least obese metropolitan areas. In its annual survey, released earlier this month, Gallup found that just 12.4 percent of Boulder residents were obese or overweight, compared with 27.1 percent nationwide. On the other end of the obesity spectrum is West Virginia's Cabell County, where the town of Huntington has an obesity rate of 39.5 percent.

So why is Boulder so much thinner?

Related A Surprising Dip in Childhood Obesity Rates

For one, almost everyone you talk to will mention the weather: 300-plus days of sunshine and an average temperature of 65 degrees. This climate, combined with the natural beauty of the Boulder Valley, makes Boulder County unusually conducive to outdoor physical activity and an important training ground for triathletes, distance runners, and cyclists.

Beyond the city’s physical characteristics, though, Boulderites are more prone to making healthy choices, including eating well. Coloradans as a whole are more likely than most to eat healthy and exercise. Statewide, just 20.4 percent of Colorado residents are obese. Farms fare well in the comparatively mild climate, and the local food movement is thriving. Yelp lists more than 25 “farm-to-table” restaurants within the Boulder city limits alone, but Travis Robinson from The Kitchen Community, a nonprofit venture focused on local food and healthy eating, says there are more than 100 across the county.

Also, two thriving farmers markets in Boulder County connect area farmers and food producers with residents and have become community meeting places, says Rachel Arndt, environmental health planner with Boulder County Public Health. The city’s Whole Foods is almost always bustling too. But Arndt is quick to point out that these amenities too often affect only the city’s more affluent residents.

“We value local foods, value healthy foods, and value shopping at health food stores,” she says. “But that’s not attainable for everyone. Engaging in the recreation isn’t either.”

Education appears to be a key indicator for whether a city’s population is prone to making healthy choices. Take Boulder and West Virginia's Cabell counties. Despite several demographic similarities between the two locations—most notably a majority white population—58 percent of Boulder County residents have a college degree, compared with just 25 percent of Cabell County residents. As a result, household income in Boulder County is nearly twice as much as in Cabell County: $67,403 versus $37,238.

Inequities exist in Boulder too. The city's public health department, under Arndt's leadership, has been working with child care centers to improve the quality of the snacks children are eating, and she is applying for grants to hire a liaison who will help lower-income Boulderites navigate the farmers markets and assist them with signing up for nutritional assistance programs.

Nonprofits like The Kitchen Community are doing their part too. The nonprofit was started in 2011 as an extension of The Kitchen, a popular family of farm-to-table restaurants. The restaurant owners saw a growing disconnect between young people and their food, a problem they hope to address with Kitchen Community–installed school gardens. The organization has worked on 200 projects, both in Boulder and in cities around the country, including Chicago and Los Angeles.

“Our founders wanted to take the concept of learning gardens out to the world,” Robinson says, “and set up in communities that don’t have access to fresh food and gardens.”

Programs like The Kitchen Community come at a time when Colorado, despite Boulder's collective healthfulness, is one of the few states where childhood obesity has been on the rise. In Boulder County, almost 12 percent of children receiving WIC benefits in 2011 were obese.

“We don’t purport that Boulder is just a utopia, a perfect place,” Robinson says. “It’s not. Obesity has no bounds.”