将纬度/经度转换为地址 [英] Convert Latitude/Longitude To Address

查看:82
本文介绍了将纬度/经度转换为地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将经纬度坐标转换为地址.我可以使用 Google Maps API,但我需要一个 XML 响应.我看过Convert Lat Long to address Google Maps 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 的 查找最近地址.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆