Skip to main content

Home is where the heart is. But is it Hart, Maryland, USA or Hart, Bayburt, Turkey? (XKCD 2480)

XKCD 2480

XKCD 2480, "No, the Other One". © Randall Monroe, 2021

Another lightning round of XKCD implementations, this time looking for all the places people have to clarify they're from. I have a fair bit of personal connection with this, with many of my friends living and working in London. It was a common frustration for them venturing out of the country to explain they weren't flying across the pond, or at least The Pond to reach the States, hailing instead from London, Ontario with its sizeable population of >300k people. All living in the shadow of one of the largest and oldest cities in the world. Oof.

However, it turns out they are only runner-ups in the race to obscurity for their London namesake. No shortage of Ohioans, Kentuckians, and even... English? Yep. For the City of London, a city entirely distinct from the city we typically know as London, bequests a similar fate unto its ~8,000 inhabitants. (Obligatory CGP Grey video about this)

XKCD 2480 showed off a bunch more examples in the States, mostly living in the shadows of other American cities. America's love for Houston, Atlanta and Dallas is endearing... if not for the broken flight plans and ruined vacations in their wake.

To see how uncreative our towns' founders are, I dusted off the cities500 GeoNames dataset and the maps.lam.io codebase and threw together a search engine for those cities who begrudgingly share their namesakes. This is more or less the raw GeoNames Gazetteer data, with the alternate names filtered for duplicates and shovelled into a query-friendly Postgres schema. Just a many-to-one relationship of alternate names to each line of cities500.txt, to be more pedantic. (See the schema at the README for this dataset.). Try it below or at cities.lam.io

Superlatives

First some db setup:

Then the fun part!

Results

All the queries really boil down to this:

SELECT * FROM (
	SELECT pc.name, p.country_code, (p.pop :: FLOAT) / pc.poprest AS frac, pc.c
	FROM pop_cmp pc
	INNER JOIN places p ON p.geonameid = pc.top_geonameid
	WHERE pc.poprest <> 0
) t
ORDER BY frac DESC LIMIT 10;

and its variations. Some of the interesting ones include:

Most lopsided (MAX(most populous city / rest))

CityProvince/StateCountryPopulation ratio (single largest pop. / Σrest)
1SanxayShanghaiChina32247.79
2MalatyaMalatyaTurkey22090.25
3BombayMaharashtraIndia17151.13
4EkoLagosNigeria12820.51
5SeuloSeoulSouth Korea11882.1
6AdaliaAntalyaTurkey11664.43
7AnfaCasablanca-SettatMorocco8063.87
8BelenaParáBrazil7953.32
9MoscuMoscowRussia7500.88
10SangayShanghaiChina5903.56
11PetrohradSt.-PetersburgRussia7415.93
12PoonaMaharashtraIndia5591.89
13DurbanKwaZulu-NatalSouth Africa4742.07
14LundenEnglandUnited Kingdom4574.39
15ChenduSichuanChina4555.03
16Santa Cruz de la SierraSanta CruzBolivia4387.1
17AstanaNur-SultanKazakhstan4374.73
18FagoNorth DakotaUnited States3591.61
19BanaresUttar PradeshIndia3307.97
20WiedenViennaAustria2926.42

Least lopsided (MIN(most populous city / rest))

CityProvince/StateCountryPopulation ratio (single largest pop. / Σrest)
1La SoledadBaja California SurMexico0.106
2Rancho NuevoSan Luis PotosíMexico0.109
3PoianaPrahovaRomania0.131
4San VicenteValenciaSpain0.15
5La LuzMichoacánMexico0.155
6San BartoloChiapasMexico0.155
7El RodeoSan MarcosGuatemala0.163
8Llano GrandeTexasUnited States0.165
9Saint-LegerNormandyFrance0.169
10Francisco VillaTlaxcalaMexico0.171
11La UnionPiuraPeru0.172
12AshlandCaliforniaUnited States0.177
13Santa EulaliaChihuahuaMexico0.178
14MiddletownOhioUnited States0.179
15Pueblo NuevoLima regionPeru0.18
16Saint-HilairePays de la LoireFrance0.185
17PervomayskoyeChechnyaRussia0.185
18El TerreroChihuahuaMexico0.185
19BergBavariaGermany0.185
20KirchbergSaxonyGermany0.187

Most common (MAX(COUNT(cities)))

CityProvince/StateCountryPopulation ratio (single largest pop. / Σrest)# cities
1Santa MariaOaxacaMexico0.297145
2San PedroCortésHonduras0.378121
3Santa CruzSanta CruzBolivia0.703111
4San JuanSan JuanArgentina0.458109
5San MiguelCaliforniaUnited States1.321108
6San AntonioTexasUnited States2.616107
7SantiagoSantiago MetropolitanChile1.97998
8San FranciscoCaliforniaUnited States1.9493
9San JoseCaliforniaUnited States1.33488
10San IsidroLima regionPeru0.24381
11Santa MaríaCaliforniaUnited States0.4480
12BuenavistaMéxicoMexico1.26976
13Saint-MartinAuvergne-Rhône-AlpesFrance0.28269
14Santa RosaCalabarzonPhilippines0.27866
15San LorenzoCentralParaguay0.76962
16San VicenteValenciaSpain0.1561
17Saint-JeanNewfoundland and LabradorCanada0.44859
18Emiliano ZapataMorelosMexico0.36659
19Santa AnaMetro ManilaPhilippines0.82355
20San PabloMinnesotaUnited States0.36952
Use it

cities.lam.io

GitHub

acrylic-origami/the-other-one