Function Repository Resource:

GeoSpatialDistanceList

Get a list of spatial distances between consecutive pairs of locations

Contributed by: Peter Cullen Burbery
 ResourceFunction["GeoSpatialDistanceList"][{loc1,loc2,…}] returns the list of successive spatial distances between consecutive pairs of locations.

Details

The spatial distance is the straight-line distance between two points on Earth, or the distance travelled if one could tunnel through the Earth from one point to the other.
The distances are returned in the unit system specified by \$UnitSystem.

Examples

Basic Examples (2)

Find the successive distances between your location, Null Island, which is the area of ocean near Africa with 0 latitude and 0 longitude, the North and South Poles, and the antipode of your location:

 In[1]:=
 Out[1]=

Convert to kilometers:

 In[2]:=
 Out[2]=

Applications (13)

A megacity, according to the United Nations Department of Economic and Social Affairs, is an urban agglomeration with 10 million inhabitants. Compute the positions for a list of megacities:

 In[3]:=
 In[4]:=
 Out[4]=

Find the successive spatial distances for a list of megacities:

 In[5]:=
 Out[5]=

Compare with the result of GeoDistanceList:

 In[6]:=
 Out[6]=

Find the difference:

 In[7]:=
 Out[7]=

Find the average decrease in distance if you could travel through the Earth:

 In[8]:=
 Out[8]=

Find how fast it would take to travel this distance at the speed of light:

 In[9]:=
 Out[9]=

Find the shortest path starting and ending at the two closest megacities to your location:

 In[10]:=
 Out[10]=

Find the index of the cities:

 In[11]:=
 Out[11]=

Find the shortest tour of all mega-cities:

 In[12]:=
 Out[12]=

Compare the distances with GeoDistance over Earth's surface and GeoSpatialDistance through space:

 In[13]:=
 Out[13]=
 In[14]:=
 Out[14]=

Find the difference:

 In[15]:=
 Out[15]=

Evaluate how fast this would take to travel at the speed of light:

 In[16]:=
 Out[16]=

Make a map of the cities with geo markers for each city:

 In[17]:=
 Out[17]=

Peter Burbery

Version History

• 1.0.0 – 22 August 2022