Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


returns the geographic entity of type enttype closest to the geo location loc.

returns the nearest of the regi.

returns the vali corresponding to the nearest regi.

returns the same result.

takes the vali to be successive integers i.

returns n nearest values.

returns up to n matches within a radius r of loc.

Details and OptionsDetails and Options

  • In GeoNearest[enttype,loc], enttype can be specified as an Entity object, such as Entity["Country"], or as a string, such as "City".
  • Valid forms of enttype include:
  • "AdministrativeDivision"administrative division of any level
    "AdministrativeDivision1"first-level administrative division
    "AdministrativeDivision2"second-level administrative division
    "AdministrativeDivision3"third-level administrative division
    "Country"country, territory, etc.
    "USCounty"US counties
    "USState"US states
    "ZIPCode"US ZIP codes
    Except[ent,enttype]entities other than ent of type enttype
    GeoVariant[enttype,variant]entities using variant regions
    EntityClass["type","class"]individual members of class
    type1|type2|any of the typei
    Allany possible type
  • Geographic regions and the locations can be specified as a GeoPosition or related point-like location object, an Entity or EntityClass object, or a GeoGraphics primitive.
  • A radius should be given as a Quantity object or the number 0.
  • GeoNearest[spec,loc,{All,r}] returns all results within radius r of loc.
  • GeoNearest always returns a list. If there are multiple nearest matches, GeoNearest[spec,loc] will return all of them.
  • GeoNearest[spec,loc,{n,r}] may return an empty list if there are no matches within the specified radius.
  • The following options can be given:
  • DistanceFunction"Boundary"how to compute distances for extended regions
    TimeConstraint30how many seconds to allow for computation
  • The following possible settings can be given for DistanceFunction:
  • "Boundary"minimum distance between any points in regions
    "Center"distance between centers of regions
    "SignedBoundary"distance to boundary, negative for interior points

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Find your current or nearest country:

Click for copyable input

The country closest to the center of the Atlantic Ocean:

Click for copyable input

The five counties nearest to Chicago, Illinois, United States:

Click for copyable input

All volcanoes within a radius of 1000 miles from London:

Click for copyable input
Introduced in 2014