America’s very richest cities, for the most part, sit along and near its coasts. The reasons, in many ways, are self-perpetuating: the most populous areas of the country give birth to new centers of industry, creating thriving professional job markets, which in turn draw large groups of highly educated and consequently well-paid people…who spend their money at artisanal bakeries. (It’s slightly more complex than that, but you get it.) Most of these cities exist in states recent studies warn are most likely to be affected by rising sea levels. From California to the Eastern Seaboard, our most sprawling—and richest—metropolises may not exist in a century or so.

This is among the most morbid takeaways from a recent 24/7 Wall St. survey identifying the country’s wealthiest and poorest cities, but one that’s relevant nonetheless. How little does the endless growth of a tech industry matter if our disregard for the environment means much of California will be underwater in the not-altogether-faraway future? Isn’t New York (which doesn’t appear below but landed at 22 on the richest cities list)’s status as a financial titan sort of moot if everyone’s so busy making money they don’t notice they’re slowly drowning? Obviously, this likely isn’t news to you, if you’re reading this. But it’s worth repeating, however preachy it sounds.

Perhaps the other takeaway from the 24/7 Wall St. compilation of rich and poor cities is actually a reminder of what a weird, contradictory place America is. The U.S. is an incredibly rich nation (and home to the world’s most millionaires) that has shameful levels of poverty. The gap between America’s richest and poorest citizens continues to widen, with the richest 20 percent of Americans possessing 84 percent of its wealth, and the poorest 40 percent owning just 0.3 percent. According to the United States Census Bureau, the poverty rate was 14.8 percent in 2014, which translates to 46.7 million Americans living in poverty. Keep in mind that poverty levels, as defined by the U.S. government, are absurdly low, starting at $11,770 for a single person and rising to $40,890 for a family of eight.

As business and finance analysis site 24/7 Wall St. points out, the income and poverty levels of a city’s residents are among the predictors of the relative wealth of that city. A number of other considerations factor in as well. Unemployment rates impact how poor or rich a city is, with joblessness obviously contributing to poverty levels. The kinds of industry present in a city also affect wealth levels, and the richest towns have tech, scientific and professional positions. It follows that education levels of a city’s inhabitants are tied to the industries in that area; highly educated people settle in places with jobs that require college and post-graduate degrees. And those jobs, predictably, offer the best compensation.

In compiling a list of the country’s richest and poorest cities, 24/7 Wall St. took a number of factors into account including poverty levels, unemployment rates and joblessness, the kinds of industries that exist in each city, and the relative concentration of educated people in each town. The site also notes that it “reviewed figures on…home values, income distribution, and educational attainment from the Census Bureau’s American Community Survey, as well as annual average unemployment rates from the Bureau of Labor Statistics, as of August 2015.”

To see the full list of the 25 richest and 25 poorest cities, visit the 24/7 Wall St. site. In the meantime, here are the top 10 in each category.

The Top 10 Richest Cities in America

10. Trenton, NJ

Median household income: $74,961

Median home value: $272,000

Unemployment rate: 5.0%

Poverty rate: 11.9%

9. Oxnard-Thousand Oaks-Ventura, CA

Median household income: $75,449

Median home value: $483,100

Unemployment rate: 5.8%

Poverty rate: 11.3%

8. Boston-Cambridge-Newton, MA-NH

Median household income: $75,667

Median home value: $375,200

Unemployment rate: 4.1%

Poverty rate: 10.6%

7. Anchorage, AK

Median household income: $75,682

Median home value: $272,700

Unemployment rate: 5.0%

Poverty rate: 9.9%

6. Midland, TX

Median household income: $77,574

Median home value: $165,600

Unemployment rate: 3.2%

Poverty rate: 7.8%

5. San Francisco-Oakland-Hayward, CA

Median household income: $83,222

Median home value: $657,300

Unemployment rate: 4.2%

Poverty rate: 10.9%

4. Bridgeport-Stamford-Norwalk, CT

Median household income: $85,925

Median home value: $408,900

Unemployment rate: 5.3%

Poverty rate: 8.9%

3. California-Lexington Park, MD

Median household income: $86,417

Median home value: $291,300

Unemployment rate: 5.2%

Poverty rate: 7.5%

2. Washington-Arlington-Alexandria, DC-VA-MD-WV

Median household income: $91,193

Median home value: $386,900

Unemployment rate: 4.3%

Poverty rate: 8.7%

1. San Jose-Sunnyvale-Santa Clara, CA

Median household income: $96,481

Median home value: $735,400

Unemployment rate: 4.1%

Poverty rate: 8.7%

The Top 10 Poorest Cities in the Country

10. Lake Havasu City-Kingman, AZ

Median household income: $37,674

Median home value: $120,200

Unemployment rate: 8.7%

Poverty rate: 20.6%

9. Grants Pass, OR

Median household income: $36,870

Median home value: $213,100

Unemployment rate: 8.2%

Poverty rate: 19.6%

8. Sumter, SC

Median household income: $36,633

Median home value: $111,100

Unemployment rate: 7.4%

Poverty rate: 24.1%

7. Valdosta, GA

Median household income: $36,340

Median home value: $110,900

Unemployment rate: 6.2%

Poverty rate: 26.0%

6. Sebring, FL

Median household income: $36,120

Median home value: $80,800

Unemployment rate: 7.8%

Poverty rate: 18.1%

5. Goldsboro, NC

Median household income: $35,966

Median home value: $105,700

Unemployment rate: 6.7%

Poverty rate: 25.5%

4. Homosassa Springs, FL

Median household income: $35,671

Median home value: $116,300

Unemployment rate: 7.6%

Poverty rate: 21.2%

3. McAllen-Edinburg-Mission, TX

Median household income: $34,801

Median home value: $79,400

Unemployment rate: 7.9%

Poverty rate: 34.0%

2. Pine Bluff, AR

Median household income: $33,838

Median home value: $80,200

Unemployment rate: 7.5%

Poverty rate: 26.2%

1. Brownsville-Harlingen, TX