gives the city entity for the current setting for $GeoLocation.
$GeoLocationCity
gives the city entity for the current setting for $GeoLocation.
Examples
open all close allBasic Examples (1)
Applications (2)
Find the distance from your current city to the border of the country, returned as a negative value:
GeoDistance[$GeoLocationCity, $GeoLocationCountry, DistanceFunction -> "SignedBoundary"]Find the next level of administrative division corresponding to the city of your current location:
$GeoLocationCity["AdministrativeDivision"]Find more data about the city:
$GeoLocationCity["Population"]Properties & Relations (3)
$GeoLocationCity gives the nearest city to your current $GeoLocation:
$GeoLocation$GeoLocationCity$GeoLocationCountry gives the nearest country to your current $GeoLocation:
$GeoLocationCountry$GeoLocationCity performs a GeoNearest call to find the nearest city to your current location:
GeoNearest["City", GeoPosition[{50, 60}]]Block temporarily the value of $GeoLocation to simulate that you are located at that position:
Block[{$GeoLocation = GeoPosition[{50, 60}]},
$GeoLocationCity
]$GeoLocationCity is automatically set, even if $GeoLocation is at sea:
$GeoLocation = GeoPosition[{0, 0}]$GeoLocationCityGeoGraphics[{GeoMarker[], Arrow@GeoPath[{$GeoLocation, $GeoLocationCity}]}, GeoRange -> Quantity[300, "Miles"]]Reset your current $GeoLocation:
$GeoLocation = FindGeoLocation[]Possible Issues (1)
$GeoLocationCity cannot be set independently of $GeoLocation:
$GeoLocationCity = Entity["City", {"NewYork", "NewYork", "UnitedStates"}]Instead, set $GeoLocation to a location included in that city:
$GeoLocation = GeoPosition[Entity["City", {"NewYork", "NewYork", "UnitedStates"}]]Then $GeoLocationCity will be automatically set:
$GeoLocationCityRestore your current $GeoLocation:
$GeoLocation = FindGeoLocation[]Tech Notes
Related Guides
History
Text
Wolfram Research (2014), $GeoLocationCity, Wolfram Language function, https://reference.wolfram.com/language/ref/$GeoLocationCity.html.
CMS
Wolfram Language. 2014. "$GeoLocationCity." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$GeoLocationCity.html.
APA
Wolfram Language. (2014). $GeoLocationCity. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$GeoLocationCity.html
BibTeX
@misc{reference.wolfram_2026_$geolocationcity, author="Wolfram Research", title="{$GeoLocationCity}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/$GeoLocationCity.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_$geolocationcity, organization={Wolfram Research}, title={$GeoLocationCity}, year={2014}, url={https://reference.wolfram.com/language/ref/$GeoLocationCity.html}, note=[Accessed: 12-June-2026]}