Function Repository Resource:

GeoMidpoint

Source Notebook

Find the midpoint between two geolocations

Contributed by: Bob Sandheinrich

ResourceFunction["GeoMidpoint"][loc1,loc2,pathtype]

computes the GeoPosition of halfway between loc1 and loc2 based on the given pathtype.

ResourceFunction["GeoMidpoint"][loc1,loc2]

uses a "Geodesic" path.

Details

The locations can be anything supported by GeoDisplacement including GeoPosition and Entity.
ResourceFunction["GeoMidpoint"] supports the geographic path types:
"Geodesic"geodesic path between points
"Rhumb","RhumbLine","Loxodrome"path of constant bearing between points
"GreatEllipse","GreatCircle"path on a plane through Earth's center

Examples

Basic Examples (1) 

Find the point between the Eiffel Tower and the Empire State Building:

In[1]:=
ResourceFunction["GeoMidpoint"][
 Entity["Building", "EiffelTower::5h9w8"], Entity["Building", "EmpireStateBuilding::h583b"]]
Out[1]=

Scope (4) 

Find half way to Null Island along a rhumb line:

In[2]:=
ResourceFunction["GeoMidpoint"][Here, GeoPosition[{0, 0}], "Rhumb"]
Out[2]=

Create a map with a midpoint:

In[3]:=
start = Entity["City", {"NewYork", "NewYork", "UnitedStates"}];
end = Entity["City", {"LosAngeles", "California", "UnitedStates"}];
GeoGraphics[
 GeoMarker /@ {start, ResourceFunction["GeoMidpoint"][start, end, "Rhumb"], end}]
Out[5]=

Find midpoints using multiple methods:

In[6]:=
start = Entity["City", {"SaintLouis", "Missouri", "UnitedStates"}];
end = Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}];
midpoints = Table[ ResourceFunction["GeoMidpoint"][start, end, type], {type, {"Rhumb", "Geodesic", "GreatEllipse"}}]
Out[8]=

See them on the a map with and without the endpoints:

In[9]:=
Row[{GeoListPlot[Flatten@{start, midpoints, end}], GeoListPlot[midpoints, GeoRange -> Quantity[80, "Kilometers"]]}]
Out[9]=

Compute a midpoint:

In[10]:=
start = Entity["City", {"SaintLouis", "Missouri", "UnitedStates"}];
end = Entity["City", {"RioDeJaneiro", "RioDeJaneiro", "Brazil"}];
midpoint = ResourceFunction["GeoMidpoint"][start, end]
Out[12]=

Show it along with geodisks of equal size:

In[13]:=
GeoListPlot[{GeoDisk[start, GeoDistance[start, end]/2],
  GeoDisk[end, GeoDistance[start, end]/2], midpoint, start, end}]
Out[13]=

Possible Issues (1) 

GeoMidpoint may print messages when one or both geolocations are extended, as for a large city:

In[14]:=
ResourceFunction["GeoMidpoint"][
 Entity["City", {"NewYork", "NewYork", "UnitedStates"}], Entity["City", {"LosAngeles", "California", "UnitedStates"}], "Rhumb"]
Out[14]=

Publisher

Bob

Version History

  • 1.0.0 – 30 January 2026

Related Resources

License Information