0
我写一个应用程序使用Xhanch API获取祈祷时间我使用this链接为此目的,但我不知道哪里可以得到几个城市的位置ID,请帮助我。谢谢获取位置ID的城市在android应用程序
我写一个应用程序使用Xhanch API获取祈祷时间我使用this链接为此目的,但我不知道哪里可以得到几个城市的位置ID,请帮助我。谢谢获取位置ID的城市在android应用程序
你在找什么叫做geoNameId。 您可以尝试以下API服务。您必须将国家/地区指定为ISO,并接收有关该国家/地区的后退信息,包括geoNameId。
例如: http://api.geonames.org/countryInfoJSON?formatted=true&lang=en&国家= DE &用户名=演示&风格=全
结果:
{
geonames: [
{
continent: "EU",
capital: "Berlin",
languages: "de",
geonameId: 2921044, //here is the geoNameId for Germany
south: 47.27,
isoAlpha3: "DEU",
north: 54.9113475100612,
fipsCode: "GM",
population: "81802257",
east: 15.0418156516163,
isoNumeric: "276",
areaInSqKm: "357021.0",
countryCode: "DE",
west: 5.86625035072566,
countryName: "Germania",
continentName: "Europa",
currencyCode: "EUR"
}
]
}
检查GEONAMES网站的详细信息: http://www.geonames.org/
谢谢您回答,但我有另一个问题:这个ID是一个统计的整个城市相同ry? – hdiz
对于每个城市还有一个geoNameID,请尝试以下链接查看示例: http://api.geonames.org/citiesJSON?formatted=true&north=44.1&south=-9.9&east=-22.4&west=55.2&lang=恩和用户名=演示和风格=全 – Drormat