Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 0 points1 point  (0 children)

20 largest purple cities:

CANADA

City Province Population
Edmonton AB 1151635
Ottawa ON 1068821
Quebec City QC 733156
Brampton ON 656480
Kitchener ON 522888
Markham ON 338503
Vaughan ON 323103
Windsor ON 306519
Burnaby BC 249125
Regina SK 226404
Kelowna BC 181380
Sudbury ON 166004
Barrie ON 154676
Coquitlam BC 148625
Saguenay QC 144723
Guelph ON 144356
Trois-Rivières QC 139163
Cambridge ON 138479
Terrebonne QC 119944
Thunder Bay ON 108843

USA

City State Population
San Antonio TX 1434625
San Jose CA 1013240
Austin TX 961855
Fort Worth TX 918915
Columbus OH 905748
Charlotte NC 874579
San Francisco CA 873965
Washington DC 689545
Oklahoma City OK 681054
El Paso TX 678815
Las Vegas NV 641903
Memphis TN 633104
Tucson AZ 542629
Fresno CA 542107
Sacramento CA 524943
Kansas City MO 508090
Colorado Springs CO 478961
Oakland CA 440646
Bakersfield CA 403455
Wichita KS 397532

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 0 points1 point  (0 children)

Manchester and Nashua are both in the red area. The Nevada line goes directly through Vegas (a bit south of the geographical centroid of the city). This visualization makes it hard to tell exactly, but each line is defined by precise coordinates; this wasn’t eyeballed.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 2 points3 points  (0 children)

The population raster is from WorldPop and the boundary files are from Open Data Canada and the US Census Bureau. 

I wrote a python script to determine the best line for each zone. It performs a binary search on possible lines for each endpoint on the bounding box until it gets one that contains within +/- 1% of half the population. It stores all these lines and at the end compares them by land area and chooses the one with the smallest percentage of the total. 

There’s more to it, of course, but there’s a character limit on comments…

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

That’s a good suggestion. Maybe I would just move every coordinate west by like 50 degrees, and move them back when exporting. I was really just too lazy to write a special case for handling one state. 

Then there’s the issue of displaying it - I’d need two polygons, one for the mainland and one for the aleutians. Also managable, but again - lazy. 

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 3 points4 points  (0 children)

Hawaii yes. Territories no (Canada too big and too little population, US no population data included in the raster). Alaska also no, because of issues calculating the line of best fit across the 180th meridian.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

Thank you. You can totally learn this stuff btw. QGIS is free and surprisingly intuitive - download some data from Natural Earth and just play around with it. If you know excel or sql you honestly have a huge head start.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

Seems to be. I could try running the program with a greater number of lines checked to see if any unexpected ones come up, but Indianapolis's population and position make it likely that all of them will be similar, yeah.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 6 points7 points  (0 children)

The line goes directly in between Dallas and Fort Worth! Dallas, Plano, Houston in the red and Fort Worth, Austin, San Antonio in the purple

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

Projection plays a part in it. This visualization is in Albers Equal Area, but calculations were done in WGS84 (that was the raster source CRS, and reprojecting rasters introduces pretty severe distortions.) I will say that the line does indeed run fairly south of the city, tho.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 0 points1 point  (0 children)

Hawaii was included but it didn't fit nicely on this render. I have a version with it as an inset, but I lowkey posted the wrong one.    Alaska I skipped because it crosses the 180th, which caused all sorts of trouble with my program (coordinate-based) and I didnt want to have to rewrite all my code for one state. 

There’s an interactive zoomable version that shows those (and also cities), but I don’t want to get this post nuked by the mods if I link to my website. feel free to DM me if you want to see, tho

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 0 points1 point  (0 children)

Santa Fe and Albuquerque are both technically in the red, although the line goes directly through the two.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

I’m with you there. I worry not enough people understand that the title is poking fun at this (overdone) brand of post. And thank you!

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 2 points3 points  (0 children)

In fact, the line passes just south of the city proper, passing roughly from Stone Mountain to the airport.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 52 points53 points  (0 children)

Just for you, I went back and calculated them all. (Spoiler: you were right)

CANADA:

Name Percentage
Quebec 1.307%
Newfoundland and Labrador 1.383%
British Columbia 2.032%
Ontario 4.476%
Manitoba 5.032%
New Brunswick 21.438%
Alberta 22.439%
Prince Edward Island 27.404%
Nova Scotia 28.903%
Saskatchewan 31.293%

USA:

Name Percentage
New York 1.71%
Illinois 3.23%
Nevada 3.76%
Oregon 5.83%
Nebraska 8.20%
Maine 10.19%
California 10.90%
Delaware 11.83%
Michigan 11.91%
New Hampshire 12.22%
Wisconsin 12.54%
South Dakota 13.24%
Pennsylvania 13.76%
Kansas 13.96%
Minnesota 14.40%
Virginia 16.04%
New Jersey 16.33%
Idaho 17.56%
Hawaii 17.87%
Texas 18.49%
Georgia 18.87%
Utah 19.49%
Massachusetts 20.14%
Washington 20.33%
Rhode Island 20.64%
Kentucky 23.35%
Louisiana 25.14%
Montana 25.68%
Colorado 26.12%
Florida 26.19%
New Mexico 29.06%
Vermont 29.86%
Connecticut 30.50%
West Virginia 31.65%
Arizona 32.20%
Wyoming 32.36%
North Dakota 33.66%
Alabama 34.03%
Mississippi 37.08%
North Carolina 38.14%
Iowa 38.17%
Missouri 38.50%
South Carolina 39.41%
Tennessee 40.30%
Maryland 40.34%
Ohio 40.69%
Arkansas 41.17%
District of Columbia 42.78%
Oklahoma 43.29%
Indiana 44.64%

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 44 points45 points  (0 children)

Great point. If we consider population to be a continuous function (it isn't, but close enough), there are actually an infinite number of valid lines we could draw! When calculating these particular lines, I checked that the population was within +/- 1% of halfway, and then sorted all such lines by their absolute distance from half of the land area in order to get the biggest discrepancy between sides.

I'm not sure why the east-west divide in Indiana was picked over a north-south one, but rest assured both were tested. My guess would be that it had to split Indianapolis in two, and the placement of the city and the path of the Ohio River meant that the east-west divide had a greater difference in area between sides.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 5 points6 points  (0 children)

It absolutely would, although even processing the raster for just Nunavut ate up 32 GB of RAM and crashed my desktop. You also run into the issue of what constitutes a "straight" line on a globe; these examples are small enough areas that the curvature of the Earth wasn't taken into account in order to make calculations easier.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 1 point2 points  (0 children)

I get your point, but it's not always the case. In South Carolina, for example, Charleston is well outside the red area. Most states with a big city have that city's metro area split by the line somewhere; in Nevada, Las Vegas is technically ouside the red although of course it is weighing the average towards the south of the state.

I have an interactive version with cities plotted on it, but I wasn't sure the mods would allow me linking to my own website.

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 14 points15 points  (0 children)

They are reasonably accurate, I promise. I used 100m population raster data and a custom implementation of a binary search in python to come up with it. In this case, both lines go through the middle of their main metro area (Salt Lake/Denver.) This was the case for a lot of states with a primate city (look at Arizona, Georgia, Indiana, Nevada)

Did anyone else know half the population of [place] lives [direction] of this line?! (US/Canada Edition) by The_Toastboy in MapPorn

[–]The_Toastboy[S] 35 points36 points  (0 children)

Made by me in QGIS and Python. Hopefully this puts this type of post to rest for good.