Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
GeoDistance
  • See Also
    • GeoDistanceList
    • GeoGridUnitDistance
    • TravelDistance
    • TravelDistanceList
    • GeoNearest
    • GeoLength
    • GeoGroup
    • GeoDirection
    • GeoDestination
    • GeoPosition
    • GeodesyData
    • DistanceMatrix
    • GeoArea
    • CentralFeature
    • SpatialMedian
  • Related Guides
    • Geodesy
    • Maps & Cartography
    • Geographic Data & Entities
    • Distance and Similarity Measures
    • Locations, Paths, and Routing
    • Transportation Data
    • Earth Sciences: Data & Computation
    • Cloud Execution Metadata
    • See Also
      • GeoDistanceList
      • GeoGridUnitDistance
      • TravelDistance
      • TravelDistanceList
      • GeoNearest
      • GeoLength
      • GeoGroup
      • GeoDirection
      • GeoDestination
      • GeoPosition
      • GeodesyData
      • DistanceMatrix
      • GeoArea
      • CentralFeature
      • SpatialMedian
    • Related Guides
      • Geodesy
      • Maps & Cartography
      • Geographic Data & Entities
      • Distance and Similarity Measures
      • Locations, Paths, and Routing
      • Transportation Data
      • Earth Sciences: Data & Computation
      • Cloud Execution Metadata

GeoDistance[{lat1,lon1},{lat2,lon2}]

gives the geodesic distance between latitude-longitude positions on the Earth.

GeoDistance[loc1,loc2]

gives the distance between locations specified by position objects or geographical entities.

GeoDistance[{loc1,…,locn}]

gives the total distance from loc1 to locn through all the intermediate loci.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Geographic Data  
Historical Data  
Options  
DistanceFunction  
UnitSystem  
Applications  
Properties & Relations  
Possible Issues  
See Also
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • GeoDistanceList
    • GeoGridUnitDistance
    • TravelDistance
    • TravelDistanceList
    • GeoNearest
    • GeoLength
    • GeoGroup
    • GeoDirection
    • GeoDestination
    • GeoPosition
    • GeodesyData
    • DistanceMatrix
    • GeoArea
    • CentralFeature
    • SpatialMedian
  • Related Guides
    • Geodesy
    • Maps & Cartography
    • Geographic Data & Entities
    • Distance and Similarity Measures
    • Locations, Paths, and Routing
    • Transportation Data
    • Earth Sciences: Data & Computation
    • Cloud Execution Metadata
    • See Also
      • GeoDistanceList
      • GeoGridUnitDistance
      • TravelDistance
      • TravelDistanceList
      • GeoNearest
      • GeoLength
      • GeoGroup
      • GeoDirection
      • GeoDestination
      • GeoPosition
      • GeodesyData
      • DistanceMatrix
      • GeoArea
      • CentralFeature
      • SpatialMedian
    • Related Guides
      • Geodesy
      • Maps & Cartography
      • Geographic Data & Entities
      • Distance and Similarity Measures
      • Locations, Paths, and Routing
      • Transportation Data
      • Earth Sciences: Data & Computation
      • Cloud Execution Metadata

GeoDistance

GeoDistance[{lat1,lon1},{lat2,lon2}]

gives the geodesic distance between latitude-longitude positions on the Earth.

GeoDistance[loc1,loc2]

gives the distance between locations specified by position objects or geographical entities.

GeoDistance[{loc1,…,locn}]

gives the total distance from loc1 to locn through all the intermediate loci.

Details and Options

  • GeoDistance[loc1,loc2] gives the distance between locations loc1 and loc2 as measured along the geodesic joining them on the surface of the reference ellipsoid. Heights are ignored.
  • The result is returned as a Quantity object with dimensions of length. The unit used can be chosen with the option UnitSystem, which has $UnitSystem as default value.
  • Latitudes and longitudes can be given as numbers in degrees, as DMS strings, or as Quantity angles.
  • Position objects in GeoDistance[loc1,loc2] can be given as GeoPosition, GeoPositionXYZ, GeoPositionENU, or GeoGridPosition objects.
  • In GeoDistance[loc1,loc2], the loci can be Entity objects with domains such as "City", "Country" and "AdministrativeDivision". Time-dependent entities of domains such as "HistoricalCountry" and "MilitaryConflict" can also be used.
  • For entities corresponding to extended geographic regions, GeoDistance by default computes the minimum distance between any points in the regions.
  • For time-dependent entities, GeoDistance by default computes the distance corresponding to the moment of closest approach between them.
  • GeoDistance[loc1,loc2] by default uses the reference ellipsoid associated with the datum for loc1.
  • GeoDistance automatically threads over lists of locations or GeoPosition arrays, so that GeoDistance[loc,locs] returns a list of distances, and GeoDistance[locs1,locs2] returns a matrix of distances. Results are given as QuantityArray objects.
  • GeoDistance and GeoDirection, or their combination in GeoDisplacement, solve the geodetic inverse problem.
  • GeoDistance has option DistanceFunction, with the following settings:
  • "Boundary"minimum distance between any points in regions
    "Center"distance between centers of regions
    "SignedBoundary"distance to boundary, negative for interior points
  • GeoDistance by default uses the setting DistanceFunction"Boundary".

Examples

open all close all

Basic Examples  (6)

Distance between two positions on the reference ellipsoid:

Distance between two cities:

Distance between two fully specified geodetic positions:

Distance between two historical entities at the time of their closest approach:

Distances from a location to a list of different locations:

Total distance between several locations:

Scope  (11)

Geographic Data  (8)

Distance between any two points on the Earth, using the parameters of the default datum "ITRF00":

Angles can also be specified as DMS strings:

Or as Quantity objects:

Compute the distance between Entity objects:

Or between an Entity object and a geo position:

Distance between geodetic positions, in different formats:

Compute distances from a common location to a list of positions, in any format:

Normalize the resulting QuantityArray object:

Compute a matrix of distances between two lists of locations:

Computing all individual distances separately is slower:

Height and time information is ignored in GeoDistance computations:

Points in different datums. The datum of the second point is changed to the datum of the first:

The difference is small:

Total distance between several locations:

Historical Data  (3)

The distance between two historical entities is the minimum distance between their territories at the same time:

Using the GeoVariant "UnionArea" performs the computation, ignoring temporal information:

Dated restricts the historical entity to a specific date:

Dated can also be given with a date interval or a pair of dates or years:

The distance between a historical entity and a non-historical entity is calculated using all territories:

Dated can be used to restrict the polygons to a given date or interval:

Options  (2)

DistanceFunction  (1)

For extended entities, the distance is computed as the minimum between boundary points:

The distance between centers is larger:

When an entity is inside the other, a signed definition of distance can be used:

UnitSystem  (1)

The default unit of the result is determined by the value of $UnitSystem:

Change to a different system:

Applications  (2)

Compute the distances from your location to all US state capital cities:

Find the minimum, maximum and mean distances:

Plot a histogram of all those distances:

Draw a Mercator map of all geodesics from your location to the US capital cities:

A nautical mile was traditionally defined as the distance corresponding to a minute of arc of a meridian:

This depends on the latitude:

The standard "NauticalMiles" unit approximates the value at latitude 45 degrees:

Properties & Relations  (10)

GeoDistance is a symmetric function:

GeoDistance is a partial inverse of GeoDestination:

GeoDistance returns part of the result returned by GeoDisplacement for point-like locations:

The length of a degree of parallel strongly depends on latitude:

But the length of a degree of meridian is approximately constant:

The distance corresponding to a given meridian angle α increases when approaching the poles:

Compute distances between consecutive pairs in a list of points with GeoDistanceList:

The same result can be obtained using Partition and GeoDistance, though in a less efficient way:

Include the distance between the last and first point:

GeoDistance computes distances between points:

GeoLength computes the length of a geo path:

Construct points on a geodesic circle, starting with regular bearings:

On an ellipsoid, they are not exactly equidistant:

Construct multiple points along a geodesic, at regular distance intervals:

The list of distances can also be obtained with GeoDistanceList:

The distance between two locations coincides with the distance between their antipodal locations:

Possible Issues  (2)

Distance between extended geo entities is computed between boundaries by default, and hence zero for contiguous entities:

Therefore, this total distance is also zero:

The GeoDistance of two historical entities that do not coexist in time returns unevaluated:

See Also

GeoDistanceList  GeoGridUnitDistance  TravelDistance  TravelDistanceList  GeoNearest  GeoLength  GeoGroup  GeoDirection  GeoDestination  GeoPosition  GeodesyData  DistanceMatrix  GeoArea  CentralFeature  SpatialMedian

Related Guides

    ▪
  • Geodesy
  • ▪
  • Maps & Cartography
  • ▪
  • Geographic Data & Entities
  • ▪
  • Distance and Similarity Measures
  • ▪
  • Locations, Paths, and Routing
  • ▪
  • Transportation Data
  • ▪
  • Earth Sciences: Data & Computation
  • ▪
  • Cloud Execution Metadata

Related Links

  • An Elementary Introduction to the Wolfram Language : Geocomputation

History

Introduced in 2008 (7.0) | Updated in 2014 (10.0) ▪ 2016 (10.4) ▪ 2024 (14.1)

Wolfram Research (2008), GeoDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistance.html (updated 2024).

Text

Wolfram Research (2008), GeoDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/GeoDistance.html (updated 2024).

CMS

Wolfram Language. 2008. "GeoDistance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/GeoDistance.html.

APA

Wolfram Language. (2008). GeoDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GeoDistance.html

BibTeX

@misc{reference.wolfram_2025_geodistance, author="Wolfram Research", title="{GeoDistance}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/GeoDistance.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_geodistance, organization={Wolfram Research}, title={GeoDistance}, year={2024}, url={https://reference.wolfram.com/language/ref/GeoDistance.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English