In a discussion on a Reddit map group, someone declared \"Maine is the united state state closest come Africa.\" Is the true? deserve to I usage my centregalilee.com mapping tools to confirm, or bust, this myth? follow along, as I dive in! ...

You are watching: How is maine the closest state to africa

The Map in mine Head (Wrong!)

My gut instincts call me that the United says is in the northern Hemisphere, and also Africa is in the southern Hemisphere, and also therefore the southeastern US says will it is in closest to Africa - right?!?

OK - I understand that\"s not really true, since much the Africa is actually north that the equator. But yet, that\"s exactly how I think the the two locations in relation to each other, in the (misguided) psychological map in mine head. Below is what the map in my head looks favor (note that i applied large latitude and longitude move to Africa, to produce this inaccurate map).

\"*\"

Actual Map

Rather 보다 relying ~ above the (inaccurate) map in mine head, let\"s plot the US and also Africa together on an yes, really map.

I ordered a copy the the united state map (and developed a brand-new ID variable through the state names), and also grabbed a copy the the Africa continent map (and produced a new ID variable through the nation names), and linked them right into one map. Ns then provided Proc SGmap to plot the an unified map polygons through an Openstreetmap elevator map. This map shows that much of Africa is ~ above the same latitude together the US, and also it\"s plausible that probably Maine yes, really is the closestly state come Africa.

proc sgmap maprespdata=both_attr mapdata=both_maps noautolegend;openstreetmap;choromap id / discrete mapid=id;run;

\"*\"

Actual Distances

Even v a suitable map, it\"s still daunting to determine exactly/definitively which us state is closest come Africa. You can be tempted to print the map, attract lines between each state and Africa, and then measure the lines with a ruler. Yet your results would be inaccurate! ...

You can\"t just measure and also compare distances on the map, due to the fact that when you produce a flat rectangular map from a sphere/globe, you need to stretch some areas more than others. In technological terms, we contact this \"stretching\" projecting the map - the Openstreetmap above uses a Pseudo-Mercator estimate to manage how lock stretch their map, because that example. And doing straightforward measurements that the stretched/projected map is not going to administer numbers you deserve to compare in a fair way, since some areas are stretched more than others.

But there\"s an alternative! We deserve to use the centregalilee.com geodist() role to calculate the geodetic distance in between two latitude/longitude coordinates. Therefore, we can pick a lat/long coordinate along the sheet of Maine, and also a coordinate along the edge of Africa, and then usage the geodist() duty to calculate the distance in between them. It\"s difficult to recognize which coordinates to use, as such I perform the calculate for all of them, and then pick the shortest (the \"brute force\" solution is frequently the easiest, as soon as there\"s many of quick & cheap computing power available!)

First, I produced a dataset, pairing every allude along every of the us state through every allude along each African country border. This ran in around 5 seconds on mine laptop, and created numerous million pairs of points.

proc sql noprint;create table distances asselect uniquestates.id together id_from, states.lat together lat_from, states.long together long_from,africa.id together id_to, africa.lat as lat_to, africa.long together long_tofrom states, africa;quit; run;

I then offered the geodist() function in a data step to calculate the distance in between each the the pairs of coordinates (excluding the clues with missing values - those space special data points to signify lakes/holes and also such). Mine laptop plowed v the several million bag of points, and calculated the distance between every pair, in around 3 seconds.

data distances; set distances (where=(lat_from^=. And long_from^=. And also lat_to^=. And also long_to^=.));distance_miles=geodist(lat_from, long_from, lat_to, long_to, \"DM\");run;

To uncover the pair v the minimum distance, i sorted the perform by distance, and also took the very first pair (obs=1). And also while creating the dataset, ns restructure the data a bit, therefore the pair the points become the endpoints for a heat I\"ll overlay on the map.

proc sort data=distances out=distances;by distance_miles;run;data shortest; collection distances (obs=1);lat=lat_from; long=long_from; output;lat=lat_to; long=long_to; output;run;

Here\"s what the 1 observation (obs=1) of the data with shortest distance looks like:

\"*\"

And here\"s what that looks like with the data modified right into two obsns, so ns can attract a line between the lat/long coordinates:

\"*\"

Plotting Results

Well, technically the text data in the table over tells me what I require to understand - Maine is indeed the closest us state come Africa. And we even have the extra info of knowing specifically what lat/long coordinates along the borders are the closest, and what the distance is (in miles). However it sure would it is in a lot an ext satisfying to watch it plotted ~ above a map, quite than just seeing text and also numbers, eh?!?

So I added a tiny bit much more code to mine previous map example to overlay a line. Ns specify a plotdata= dataset, and also then include a collection statement to plot the lat/long works with joined v a line.

See more: My Guinea Pig Is Drinking A Lot Of Water, (Things You Should Know)

proc sgmap maprespdata=both_attr mapdata=both_maps plotdata=shortest noautolegend;openstreetmap;choromap id / discrete mapid=id lineattrs=(thickness=1 color=gray88);series x=long y=lat / lineattrs=(color=red);run;

\"*\"

You desire More?

If you prefer this kind of geographical trivia topic, girlfriend might likewise enjoy my blog post around 27 US claims being aside from that north than Canada! and for those of you who room centregalilee.com programmers, here\"s the finish centregalilee.com code I provided to create this example.