在BingMap中从经度和纬度获取位置名称 [英] Getting Location Name from Longitude and Latitude in BingMap

查看:85
本文介绍了在BingMap中从经度和纬度获取位置名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WP7开发人员.我有一个位置的经度和纬度.无论如何要获取信息的坐标定义的位置,即经度和纬度. 谢谢!!

I am a WP7 developer. I have longitude and latitude of a location. Is there anyway to get the info the location defined by the coordinate ie longitude and latitude. Thank you!!

推荐答案

是的,您可以通过必应Maps REST API ,您需要执行反向地理编码.这是通过GET-ing以下请求来完成的:

Yes, you can do this via the Bing Maps REST API, you need to perform a reverse geocode. This is done by GET-ing the following request:

http://dev.virtualearth.net/REST/v1/Locations/47.64054,-122.12934?o=xml&key=BingMapsKey

这将以XML格式返回地址:

Which will return the address in XML format:

<Response xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
  <Copyright>
    Copyright © 2011 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
  </Copyright>
  <BrandLogoUri>
    http://dev.virtualearth.net/Branding/logo_powered_by.png
  </BrandLogoUri>
  <StatusCode>200</StatusCode>
  <StatusDescription>OK</StatusDescription>
  <AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
  <TraceId>
    dd31ffaf098f4406b7ecdd0da36680ff
  </TraceId>
  <ResourceSets>
    <ResourceSet>
      <EstimatedTotal>1</EstimatedTotal>
      <Resources>
        <Location>
          <Name>1 Microsoft Way, Redmond, WA 98052</Name>
          <Point>
            <Latitude>47.640568390488625</Latitude>
            <Longitude>-122.1293731033802</Longitude>
          </Point>
          <BoundingBox>
            <SouthLatitude>47.636705672917948</SouthLatitude>
            <WestLongitude>-122.137016420622</WestLongitude>
            <NorthLatitude>47.6444311080593</NorthLatitude>
            <EastLongitude>-122.1217297861384</EastLongitude>
          </BoundingBox>
          <EntityType>Address</EntityType>
          <Address>
            <AddressLine>1 Microsoft Way</AddressLine>
            <AdminDistrict>WA</AdminDistrict>
            <AdminDistrict2>King Co.</AdminDistrict2>
            <CountryRegion>United States</CountryRegion>
            <FormattedAddress>1 Microsoft Way, Redmond, WA 98052</FormattedAddress>
            <Locality>Redmond</Locality>
            <PostalCode>98052</PostalCode>
          </Address>
          <Confidence>Medium</Confidence>
          <MatchCode>Good</MatchCode>
          <GeocodePoint>
            <Latitude>47.640568390488625</Latitude>
            <Longitude>-122.1293731033802</Longitude>
            <CalculationMethod>Interpolation</CalculationMethod>
            <UsageType>Display</UsageType>
            <UsageType>Route</UsageType>
          </GeocodePoint>
        </Location>
      </Resources>
    </ResourceSet>
  </ResourceSets>
</Response>

这篇关于在BingMap中从经度和纬度获取位置名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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