次の方法で共有


Bing Maps Find a Location by Point API の移行

この記事では、Bing Maps Find a Location by Point API を Azure Maps Get Reverse Geocoding API. に移行する方法について説明します。 Azure Maps Get Reverse Geocoding API は、経度と緯度の座標を人間が理解できる住所に変換するために使用されます。

前提条件

主な相違点

  • Bing Maps Find a Location by Point API は、XML および JSON 応答形式をサポートしています。 Azure Maps Get Polygon API では、GeoJSON 応答形式がサポートされています。
  • Bing Maps Find a Location by Point API では、緯度/経度形式の座標が使用されます。 Azure Maps Get Reverse Geocoding API では、GeoJSON で定義されている経度/緯度形式の座標が使用されます。
  • Bing Maps Find a Location by Point API とは異なり、Azure Maps Get Reverse Geocoding API は現在、中国、日本、韓国の住所や街路レベルのデータをサポートしていません。
  • Bing Maps Find a Location by Point API とは異なり、Azure Maps Get Reverse Geocoding API には view 入力パラメーターがあります。これは、ISO 3166-1 Alpha-2 リージョン/国コードを表す文字列です。 view 入力パラメーターは、地政学的な紛争の境界線とラベルを、指定されたユーザー領域に合わせて変更します。 詳細については、「URI パラメーター」を参照してください。
  • Azure Maps は、Bing Maps for Enterprise とは異なり、地理的範囲の指定をサポートするグローバル サービスです。これにより、データ所在地をヨーロッパ (EU) または米国 (US) の地理的地域 (geo) に制限できます。 (入力データを含む) すべての要求は、指定された地理的領域内でのみ処理されます。 詳しくは、「Azure Maps サービスの地域スコープ」をご覧ください。

セキュリティと認証

Bing Maps for Enterprise は、API キー認証のみをサポートします。 Azure Maps は、サブスクリプション キーMicrosoft Entra IDShared Access Signature (SAS) トークンなど、API 呼び出しを認証する方法を複数サポートします。 Azure Maps のセキュリティと認証の詳細については、「Azure Maps による認証」と、Azure Maps のジオコーディングの取得に関するドキュメントの「セキュリティ」セクションを参照してください。

要求パラメーター

次の表に、Bing Maps Find a Location by Point 要求パラメーターと同等の Azure Maps パラメーターを示します。

Bing Maps の要求パラメーター Bing Maps の要求パラメーターの別名 Azure Maps の要求パラメーター Azure Maps で必須であるか Azure Maps のデータ型 説明
culture c 要求ヘッダー: Accept-Language False string Azure Maps Get Reverse Geocoding API では、これは検索結果を返す言語です。 これは、Azure Maps 要求ヘッダーで指定されます。 詳細については、サポートされている言語に関するページを参照してください。
include incl 不要 不要 不要 Bing Maps Find a Location by Point では、応答の場所の結果の 2 文字の ISO 国コードを取得するために ‘include’ 入力パラメーターが必要です。 Azure Maps Get Reverse Geocoding API では、既定で 2 文字の ISO 国コードが返されます。
includeEntityTypes resultTypes False クエリ
includeNeighborhood inclnb 不要 不要 不要 Azure Maps Get Reverse Geocoding API では、近隣情報が利用可能な場合、既定で応答に近隣情報が返されます。
point coordinates True number[] Bing Maps Find a Location by Point API では、要求の座標と応答の座標は緯度/経度形式ですが、Azure Maps Get Reverse Geocoding API では、GeoJSON で定義されているように、要求の座標と応答の座標が経度/緯度形式である必要があります。
userRegion ur ビュー False string ISO 3166-1 Alpha-2 地域/国コードを表す文字列。 これは、地政学的な紛争の境界線とラベルを、指定されたユーザー領域に合わせて変更します。 要求で定義していない場合でも、既定で View パラメーターは “Auto” に設定されています。

詳細と使用可能なビューについては、サポートされているビューに関するページを参照してください。
verboseplacenames vbpn サポート対象外 サポートされていません サポート対象外 Azure Maps の Get Reverse Geocoding API がサポートするのは、adminDistricts の短縮名 (Florida の代わりに FL) を返すことのみです。

Azure Maps Get Reverse Geocoding API 要求パラメーターの詳細については、「URI パラメーター」を参照してください。

要求の例

Bing Maps Find a Location by Point API の要求:

https://dev.virtualearth.net/REST/v1/Locations/48.830345,2.338166&key={BingMapsKey}  

Azure Maps Get Reverse Geocoding API の要求:

http://atlas.microsoft.com/reverseGeocode?api-version=2023-06-01&coordinates=2.338166,48.830345&subscription-key={Your-Azure-Maps-Subscription-key}

応答フィールド

次の表に、Bing Maps Find a Location by Point 要求の実行時に HTTP 応答に表れる可能性があるフィールドと、Azure Maps の同等のフィールドを示します。

Bing Maps の応答 Azure Maps の応答 説明
address: addressLine (JSON)
Address: AddressLine (XML)
address: addressLine
address: adminDistrict (JSON)
Address: AdminDistrict (XML)
address: adminDistricts
address: adminDistrict2 (JSON)
Address: AdminDistrict2 (XML)
address: adminDistricts
address: countryRegion (JSON)
Address: CountryRegion (XML)
address: countryRegion
address: countryRegionIso2 (JSON)
Address: CountryRegionIso2 (XML)
address: countryRegion - iso
address: neighborhood (JSON)
Address: Neighborhood (XML)
address: neighborhood
address: formattedAddress (JSON)
Address: FormattedAddress (XML)
address: formattedAddress
address: locality (JSON)
Address: Locality (XML)
address: locality
address: postalCode (JSON)
Address: PostalCode (XML)
address: postalCode
address: Intersection – baseStreet (JSON)
Address: Intersection – BaseStreet (XML)
address: intersection -baseStreet
address: Intersection – secondaryStreet1 (JSON)
Address: Intersection – SecondaryStreet1 (XML)
address: intersection - secondaryStreet1
address: Intersection – secondaryStreet2 (JSON)
Address: Intersection – SecondaryStreet2 (XML)
address: intersection - secondaryStreet2
address: Intersection – intersectionType (JSON)
Address: Intersection – IntersectionType (XML)
address: intersection - intersectionType
address: Intersection – displayName (JSON)
Address: Intersection – DisplayName (XML)
address: intersection - displayName
bbox (JSON)
BoundingBox (XML)
features: bbox Bing Maps Find a Location by Point API では、応答の座標は緯度/経度形式です。 Azure Maps Get Reverse Geocoding API の応答の座標では、GeoJSON で定義されている経度/緯度が使用されます。
calculationMethod (JSON)
CalculationMethod (XML)
properties: geocodePoints - calculationMethod
confidence (JSON)
Confidence (XML)
properties: confidence
entityType (JSON)
EntityType (XML)
properties: type
geocodePoints (JSON)
GeocodePoint (XML)
properties: geocodePoints - coordinates
matchCodes (JSON)
MatchCode (XML)
properties: matchCodes
name (JSON)
Name (XML)
サポートされていません Azure Maps formattedAddress は Bing Maps name と同様の価値を提供します。
point (JSON)
Point (XML)
features: coordinates Bing Maps Find a Location by Point API では、応答の座標は緯度/経度形式です。 Azure Maps Get Reverse Geocoding API の応答の座標では、GeoJSON で定義されている経度/緯度形式が使用されます。
usageTypes (JSON)
usageType (XML)
properties: geocodePoints: usageTypes

Azure Maps Get Reverse Geocoding API 応答フィールドの詳細については、「定義」を参照してください。

応答例

次の JSON サンプルは、Bing Maps Find a Location by Point 要求を実行したときに HTTP 応答の本文に返される内容を示しています。

{
    "authenticationResultCode": "ValidCredentials",
    "brandLogoUri": "https://dev.virtualearth.net/Branding/logo_powered_by.png",
    "copyright": "Copyright © 2024 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.826534682429326,
                        2.330334564829834,
                        48.83426011757068,
                        2.345980835170166
                    ],
                    "name": "30 Rue Cabanis, 75014 Paris, France",
                    "point": {
                        "type": "Point",
                        "coordinates": [
                            48.8303974,
                            2.3381577
                        ]
                    },
                    "address": {
                        "addressLine": "30 Rue Cabanis",
                        "adminDistrict": "Île-de-France",
                        "adminDistrict2": "Paris",
                        "countryRegion": "France",
                        "formattedAddress": "30 Rue Cabanis, 75014 Paris, France",
                        "intersection": {
                            "baseStreet": "Rue Cabanis",
                            "secondaryStreet1": "Villa de Lourcine",
                            "intersectionType": "Near",
                            "displayName": "Rue Cabanis and Villa de Lourcine"
                        },
                        "locality": "Paris",
                        "neighborhood": "14th Arrondissement",
                        "postalCode": "75014"
                    },
                    "confidence": "High",
                    "entityType": "Address",
                    "geocodePoints": [
                        {
                            "type": "Point",
                            "coordinates": [
                                48.8303974,
                                2.3381577
                            ],
                            "calculationMethod": "Rooftop",
                            "usageTypes": [
                                "Display"
                            ]
                        }
                    ],
                    "matchCodes": [
                        "Good"
                    ]
                }
            ]
        }
    ],
    "statusCode": 200,
    "statusDescription": "OK",
    "traceId": "c525b02f7f1e9e4ee3d7b81cce266671"

次の JSON サンプルは、Azure Maps Get Reverse Geocoding 要求を実行したときに HTTP 応答の本文に返される内容を示しています。

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    2.3381577,
                    48.8303974
                ]
            },
            "properties": {
                "geocodePoints": [
                    {
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                2.3381577,
                                48.8303974
                            ]
                        },
                        "calculationMethod": "Rooftop",
                        "usageTypes": [
                            "Display"
                        ]
                    }
                ],
                "address": {
                    "addressLine": "30 Rue Cabanis",
                    "adminDistricts": [
                        {
                            "shortName": "Île-de-France"
                        },
                        {
                            "shortName": "Paris"
                        }
                    ],
                    "countryRegion": {
                        "name": "France",
                        "iso": "FR"
                    },
                    "intersection": {
                        "baseStreet": "Rue Cabanis",
                        "displayName": "Rue Cabanis and Villa de Lourcine",
                        "intersectionType": "Near",
                        "secondaryStreet1": "Villa de Lourcine",
                        "secondaryStreet2": null
                    },
                    "locality": "Paris",
                    "neighborhood": "14th Arrondissement",
                    "postalCode": "75014",
                    "formattedAddress": "30 Rue Cabanis, 75014 Paris, France"
                },
                "confidence": "High",
                "matchCodes": [
                    "Good"
                ],
                "type": "Address"
            },
            "bbox": [
                2.330334564829834,
                48.826534682429326,
                2.345980835170166,
                48.83426011757068
            ]
        }
    ]
}

トランザクションの使用法

Bing Maps Find a Location by Point API のように、Azure Maps Get Reverse Geocoding API は、要求ごとに 1 つの課金対象のトランザクションを記録します。 Azure Maps トランザクションの詳細については、「Azure Maps トランザクションの理解」を参照してください。

追加情報

サポート