问题标签 [geonames]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 通过提供 lat 和 long 获取地名
在我的应用程序中,我想通过提供城市来获取我正在使用的天气报告http://www.google.com/ig/api?weather= "" 。但对我来说只有纬度和经度可用
如何通过纬度和经度获取地名。
mysql - 使用地名数据库获取城市所属的州和县?
我已经从 geonames.org 下载了整个数据库并将所有国家/地区导入 mysql。
我想知道当我获得一个城市的 ID 后,我如何获得大陆、国家、州、县?
因为我想用这些信息制作一个级联列表菜单。
谢谢!
jquery - Google 位置的格式化地址是否唯一?
我希望我们的网站用户能够
- 搜索并选择地址或在地图上标记位置
- 确定此地址/位置的准确性
我正在使用 jquery、jquery ui 的自动完成、谷歌地图和谷歌地理编码器实现第一部分。对于第二部分,我将使用 jquery 在客户端基于第一部分的地址元素/替代项生成一个单选按钮列表。
然而,我关心的是如何将选择传达给服务器端。Google 地理编码器包含许多我想要存储的有用元数据。
- 一种可能是将完整的 json 对象存储在隐藏的表单字段中,但我不能信任用户。这样的解决方案将允许在数据中不友好地插入垃圾邮件。
- 如果地址/位置有唯一标识符,我可以只存储这些并让服务器重新获取/评估数据。替代的 geonames.org 网络服务有这样的 id。但是,例如,Google 位置的格式化地址是唯一的吗?
有小费吗?
api - 是否有 API 将 long/lat 转换为城市、国家而不是 Google API
是否有 API 将 long/lat 转换为城市、国家而不是 Google API?
我发现地名并没有给出城市。
谢谢,玲
iphone - NSXMLParser 和 Geonames
我正在尝试使用 iPhone SDK 中的 NSXMLParser 解析来自 Geonames 的调用。我以前用过这个,但由于某种原因,我得到了一个空字典,即使我在网络浏览器中得到了结果。有人可以指出我可能做错了什么。
以下是我正在使用的代码以及将其粘贴到浏览器中的结果。
提前致谢
以下是在搜索“波士顿”一词时使用上述相同调用在浏览器中返回的结果:
jquery - JQuery Map 和 JSON - 获取子数组元素
我正在使用 JQuery 从地名中获取城市数据。我的问题是当我想在使用 JQuery 映射函数时提取子数组项的值时。
在此示例中,如果我想获取 Wikipedia 链接,我该怎么做?
我试过:维基百科:item.alternateNames.lang['link']
但没想到它真的会起作用。有谁知道我可以提取子数组项吗?
以下是一些代码:
JSON 结果
查询:
django - Geodjango 与 Geonames
我想根据地名邮政编码转储实现基于位置的搜索。为此,我想使用 geodjango,但我不知道如何实现地理名称数据以进行查找。我不想使用外部网络服务。
也许有人已经意识到这一点并对我有一些启发?
routing - Assessing OpenStreetMap for international routing
I have been using a commercial solution for route distances and travel times for North America and Western/Mid Europe. I am considering expanding the project to cover other countries - and perhaps the entire world. A very limited budget and patchy regional coverage from individual commercial providers, probably make locally-hosted OpenStreetMap the only viable option. Before someone suggests an online solution, my application requires a lot of intensive route calculation - something which would cost a lot or be very impolite (and probably banned) if performed using a web service. The results of the calculations are put back in the public domain, so rediting OpenStreetMaps is not a problem.
My problem is how do I assess the routing data coverage for individual countries in the OpenStreetMap database? Such an assessment could determine if the project is viable, and a suitable order for processing (ie. do the countries with the best coverage first).
High-end commercial data providers can typically supply statistical descriptions, as well as regional descriptions of surveyed coverage. OpenStreetMap is much more patchy - an area typically includes some roads, but not all roads. Individual location errors of a few metres of even 10-20m will not be a problem for my application (I'm looking at city-city distances), but route graph connectivity is. Ie. the road vectors must logically meet correctly at a junction.
Has anyone attempted to create statistics describing data coverage of the OpenStreetMap database?
If not, how would you go about it?
The best I can think of is to take a random sampling of places (eg. cities), and then attempt to calculate routes. There would have to be an assumption that the major roads will tend to be added before the minor roads. Therefore a route between two distant cities would use the logical major road, and not a minor road (which is typically longer/slower) because the major road is missing.
Another problem would be that it is physically not possible to drive between many towns. Often this is due to the presence of islands (where ferries could be used) but often there is no surface route (eg. settlements in Nunavut). So how would such statistics be used when comparing between (say) Tonga and Afghanistan. Afganistan probably has very low data coverage. Tonga is probably better but the settlements are spread out across an archipelago.
Some details about my application: All start and end points are towns and cities with locations taken from the Geonames database. Typically I am looking at the 1000 largest cities in a country that also have a population of at least 1000. Routes are currently calculated in duplicate as both fastest routes and shortest routes. Reasonable road speeds vary according to broad road categories. Estimated travel times are computed alongside road distances. These details are preferences for consistency- they are not set in stone.
iphone - iPhone 应用程序的位置搜索 API
我目前有一个应用程序,其中包含一个屏幕,用户可以在其中搜索位置或地点(如曼哈顿、自由女神像、巴黎或金门大桥),然后他们会返回结果列表。当他们选择一个结果时,我会为结果做一些纬度/经度的事情。这目前使用的是 geonames.org,它有时非常不可靠。
我的问题很简单,有没有可以替代 geonames.org 的替代品,我可以用作主要或后备?API 需要可以用于商业用途,公开 REST 风格的界面,最好是免费或接近免费的商业用途。任何帮助将非常感激。
android - 在 Android 上运行地名的 OutofBoundsException
我有一个简单的问题,我似乎无法弄清楚。我正在尝试执行 geoname WebService.search 方法并不断收到“java.lang.StringIndexoutOfBoundsException”错误。我在普通的旧 Java 下运行该程序,它运行良好,没有问题。我在 Android 下运行它,我得到“java.lang.StringIndexoutOfBoundsException”错误。我在清单中设置了“Internet”权限。执行 Webservice.search(searchCriteria) 时发生错误。这是代码:
当我执行 WebService.search(searchCriteria) 方法时发生故障。我在 LogCat 中得到的错误是:
我已经正确地将 jdom.jar 和 geonames.-1.0.6.jar 放在我的 Java 构建路径中,所以我认为那里没有问题。有趣的是,它重新编写了使用 WebService.postalCodeSearch(postalSearch) 和 WebService.weatherIcao("KPBI") 的代码,它在 Android 中完美运行,没有任何问题。就像我说的,这段代码在 Java SE6 下运行一整天。关于什么可能是错的任何想法?