2017-12-06 15 views

答えて

-1

Bing MapsのREST場所のAPIを使用してクエリ(郵便、国を...)ジオコード。要求の一部として、国のISO2コード値を返す&incl=ciso2を追加します。たとえば、次のように見つけることができBing MapsのREST Locaiton APIの"countryRegionIso2": "AT"

ドキュメントがある応答のアドレスプロパティで

{ 
"authenticationResultCode": "ValidCredentials", 
"brandLogoUri": "http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png", 
"copyright": "Copyright © 2017 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.", 
"resourceSets": [{ 
    "estimatedTotal": 1, 
    "resources": [{ 
     "__type": "Location:http:\/\/schemas.microsoft.com\/search\/local\/ws\/rest\/v1", 
     "bbox": [48.237850189209, 16.3536491394043, 48.3225288391113, 16.4731197357178], 
     "name": "1210, Austria", 
     "point": { 
      "type": "Point", 
      "coordinates": [48.2801895141602, 16.4104042053223] 
     }, 
     "address": { 
      "adminDistrict": "Vienna", 
      "adminDistrict2": "Vienna", 
      "countryRegion": "Austria", 
      "formattedAddress": "1210, Austria", 
      "locality": "Vienna", 
      "postalCode": "1210", 
      "countryRegionIso2": "AT" 
     }, 
     "confidence": "High", 
     "entityType": "Postcode1", 
     "geocodePoints": [{ 
      "type": "Point", 
      "coordinates": [48.2801895141602, 16.4104042053223], 
      "calculationMethod": "Rooftop", 
      "usageTypes": ["Display"] 
     }], 
     "matchCodes": ["Good"] 
    }] 
}], 
"statusCode": 200, 
"statusDescription": "OK", 
"traceId": "cb93431f2caa4f9fb2fcdbaa0ae80b74|CO30324109|7.7.0.0|" 
} 

お知らせ:

https://dev.virtualearth.net/REST/v1/Locations?q=1210%2C%20AT&incl=ciso2&key=YOUR_Bing_Maps_Key

は以下を返します。ここをクリックしてください:https://msdn.microsoft.com/en-US/library/ff701711.aspx

ここにベストプラクティスガイドがあります:https://msdn.microsoft.com/en-us/library/dn894107.aspx

あなたはBing MapsのREST .NETツールキットを使用することをお勧めします.NETを使用している場合:https://github.com/Microsoft/BingMapsRESTToolkitそれは.NETのRESTサービスを利用することが本当に簡単になり、また、簡単にあなたのプロジェクトに含めるためのNuGetパッケージを持っています。

+0

ありがとうございました。しかし私は国のISO2コードは必要ありません。私はISO 3166-2 Code(Subdivision)が必要です(wikipediaリンクを参照)。 – Mathias

+0

サブディビジョンISO2コードはプラットフォームでは使用できないため、追加する計画はありません。 – rbrundritt

関連する問題