转换纬度/经度地址 [英] Convert Latitude/Longitude To Address
问题描述
我需要一个纬度/经度坐标转换为地址。我可以使用谷歌地图API,但我需要一个XML响应。
我看过<一个href=\"http://stackoverflow.com/questions/15700845/convert-lat-long-to-address-google-maps-apiv2\">Convert Lat Long网,以解决谷歌地图ApiV2 但我需要能够做到这一点在JavaScript中。结果
我的问题是:如何转换纬度/经度坐标地址
I need to convert a lat/long coordinates to a address. I could use the Google Maps API but I would need a XML Response.
I have looked at Convert Lat Long to address Google Maps ApiV2 but I need to be able to do this in JavaScript.
My Question is: How To Convert a Lat/Long coordinate to an address?
推荐答案
您可以使用GeoNames的'的 FindNearestAddress 。
You can use GeoNames' FindNearestAddress.
它需要一个经度和纬度参数和以XML格式返回最接近的地址
It takes a latitude and longitude parameter and returns the nearest address in XML format.
从例如:
http://api.geonames.org/findNearestAddress?lat=37.451&lng=-122.18&username=demo
<address>
<street>Roble Ave</street>
<mtfcc>S1400</mtfcc>
<streetNumber>649</streetNumber>
<lat>37.45127</lat>
<lng>-122.18032</lng>
<distance>0.04</distance>
<postalcode>94025</postalcode>
<placename>Menlo Park</placename>
<adminCode2>081</adminCode2>
<adminName2>San Mateo</adminName2>
<adminCode1>CA</adminCode1>
<adminName1>California</adminName1>
<countryCode>US</countryCode>
</address>
</geonames>
这篇关于转换纬度/经度地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!