azurereverse-geocodingazure-maps

Azure Maps reverse geocoding problem with coordinates


I started using Azure Maps reverse geocoding REST API endpoint and for requests with coordinates from my region (Poland) its returning results from Saudi Arabia

My request:

Lat - 51.762036 Long - 19.532306

curl

curl --location 'https://atlas.microsoft.com/reverseGeocode?subscription-key={mySubscriptionKey}&
api-version=2023-06-01&
coordinates=51.762036%2C%2019.532306'

http

GET /reverseGeocode?
subscription-key={mySubscriptionKey}&
api-version=2023-06-01&
coordinates=51.762036, 19.532306 HTTP/1.1
Host: atlas.microsoft.com

And this is my results:

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    51.76203536987305,
                    19.532306671142578
                ]
            },
            "properties": {
                "geocodePoints": [
                    {
                        "geometry": {
                            "type": "Point",
                            "coordinates": [
                                51.76203536987305,
                                19.532306671142578
                            ]
                        },
                        "calculationMethod": "Rooftop",
                        "usageTypes": [
                            "Display"
                        ]
                    }
                ],
                "address": {
                    "adminDistricts": [
                        {
                            "shortName": "Eastern"
                        }
                    ],
                    "countryRegion": {
                        "name": "Saudi Arabia",
                        "iso": "SA"
                    },
                    "formattedAddress": "Eastern"
                },
                "confidence": "Medium",
                "matchCodes": [
                    "Good",
                    "UpHierarchy"
                ],
                "type": "AdminDivision1"
            },
            "bbox": [
                51.7210569322467,
                19.50333628815002,
                51.8030138074994,
                19.561277054135136
            ]
        }
    ]
}

For some coordinates presented on samples it works fine, is there something I'm doing wrong with my request?


Solution

  • Azure Maps aligns with the geospatial standard of "longitude, latitude" (similar to x,y), reverse the numbers in your coordinates and you should see results in the right part of the world.

    Note, the response is in GeoJSON format which is an open geospatial standard format. Its specification requires the "longitude, latitude" format.