$GeoLocationCountry
给出 $GeoLocation 当前设置的国家实体.
范例
打开所有单元 关闭所有单元基本范例 (1)
应用 (2)
属性和关系 (3)
$GeoLocationCountry 给出距离当前的 $GeoLocation 最近的国家/地区:
$GeoLocation$GeoLocationCountry$GeoLocationCity 给出距离当前的 $GeoLocation 最近的城市:
$GeoLocationCity$GeoLocationCountry 执行一个 GeoNearest 调用找到离当前位置最近的国家:
GeoNearest["Country", GeoPosition[{50, 60}]]临时阻挡 $GeoLocation 值以模拟你位于那个位置:
Block[{$GeoLocation = GeoPosition[{50, 60}]},
$GeoLocationCountry
]$GeoLocationCountry 是自动设置的,即使 $GeoLocation 位于海上:
$GeoLocation = GeoPosition[{0, 0}]$GeoLocationCountryGeoGraphics[{GeoMarker[$GeoLocation], Polygon[$GeoLocationCountry]}]重置当前的 $GeoLocation:
$GeoLocation = FindGeoLocation[]可能存在的问题 (1)
$GeoLocationCountry 的设置不能独立于 $GeoLocation:
$GeoLocationCountry = Entity["Country", "UnitedStates"]相反,请将 $GeoLocation 设置为包含在该国家中的位置:
$GeoLocation = GeoPosition[Entity["City", {"NewYork", "NewYork", "UnitedStates"}]]然后,$GeoLocationCountry 将被自动设置:
$GeoLocationCountry恢复你当前的 $GeoLocation:
$GeoLocation = FindGeoLocation[]技术笔记
相关链接
文本
Wolfram Research (2014),$GeoLocationCountry,Wolfram 语言函数,https://reference.wolfram.com/language/ref/$GeoLocationCountry.html.
CMS
Wolfram 语言. 2014. "$GeoLocationCountry." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/$GeoLocationCountry.html.
APA
Wolfram 语言. (2014). $GeoLocationCountry. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/$GeoLocationCountry.html 年
BibTeX
@misc{reference.wolfram_2026_$geolocationcountry, author="Wolfram Research", title="{$GeoLocationCountry}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/$GeoLocationCountry.html}", note=[Accessed: 15-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_$geolocationcountry, organization={Wolfram Research}, title={$GeoLocationCountry}, year={2014}, url={https://reference.wolfram.com/language/ref/$GeoLocationCountry.html}, note=[Accessed: 15-August-2026]}