我需要对地址进行地理编码以查找纬度和经度。但我只需要 XML/JSON 格式的响应,我不想在 map 上显示它。如果没有 map ,则禁止使用 Google 地理编码。请建议一种方法来做到这一点。
最佳答案
您可以尝试 OpenStreetMap 的 Nominatim 服务,例如:
http://wiki.openstreetmap.org/wiki/Nominatim
以下搜索的示例输出
http://nominatim.openstreetmap.org/search.php?q=brandenburger+tor%2C+berlin%2C+deutschland&format=json
是
[{"place_id":"67311118","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright","osm_type":"way","osm_id":"104393803","boundingbox":["52.5159645080566","52.5165634155273","13.3776025772095","13.3781223297119"],"lat":"52.51626405","lon":"13.3777246125974","display_name":"Brandenburger Tor, Pariser Platz, Berliner Urstromtal, Mitte, Berlin, 11011, Deutschland, Europ\u00e4ische Union","class":"tourism","type":"attraction","importance":1.1434728583616,"icon":"http://nominatim.openstreetmap.org/images/mapicons/poi_point_of_interest.p.20.png"}]
关于geocoding - 如何在没有 map 的情况下在 JAVA 中进行地理编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22201817/