$GeoLocation
is a settable global variable that specifies the default geodetic location to use.
Details
- $GeoLocation is a GeoPosition object containing {latitude,longitude} or {latitude,longitude,elevation}.
- By default, $GeoLocation has a delayed value of FindGeoLocation[], which gives the inferred geo location of the user originating the current request.
- $GeoLocationSource gives the source for the inferred geo location. If $GeoLocation is reset, $GeoLocationSource is set to "User".
Examples
open allclose allBasic Examples (3)
Scope (5)
The default value of $GeoLocation is given by FindGeoLocation:
It is computed using the "GeoIP" source:
Set a new value for your default geo location:
Reset the value to its default:
Set $GeoLocation using a {lat,lon} pair in degrees:
The value assigned to $GeoLocation is a GeoPosition object:
Reset the value to its default:
Set $GeoLocation using a {lat,lon,height} triple, with geodetic height in meters:
The value assigned to $GeoLocation is a GeoPosition object:
Reset the value to its default:
Use Block to temporarily simulate that you are located at a different position:
Outside the Block scoping construct, the variable $GeoLocation still preserves its original value:
Properties & Relations (4)
The values of $GeoLocation and Here coincide:
GeoGraphics with no positional information centers the world map at $GeoLocation:
Set your default geo location to a different value:
Reset $GeoLocation:
Changing $GeoLocation updates $GeoLocationCity and $GeoLocationCountry automatically:
Reset to the current location:
Convert $GeoLocation into other geo position formats. A 3D vector from the center of the Earth:
Possible Issues (2)
Changing $GeoLocation does not automatically affect $TimeZone, which is independently settable:
$TimeZone still gives your current time zone, and not London's time zone:
Use LocalTimeZone to find the time zone for a given location—in this case, the new $GeoLocation:
Reset $GeoLocation and $TimeZone to your local values:
$GeoLocation can store a GeoPosition value with elevation, but not with a date:
Text
Wolfram Research (2008), $GeoLocation, Wolfram Language function, https://reference.wolfram.com/language/ref/$GeoLocation.html (updated 2014).
CMS
Wolfram Language. 2008. "$GeoLocation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/$GeoLocation.html.
APA
Wolfram Language. (2008). $GeoLocation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$GeoLocation.html