Empty CalculationMethodEnum in Geocoding Response

François Victor 0 Reputation points
2025-10-27T10:46:12.9+00:00

According to the documentation at

https://learn.microsoft.com/en-us/rest/api/maps/search/get-geocoding?view=rest-maps-2025-01-01&tabs=HTTP#calculationmethodenum

CalculationMethodEnum should be one of "Interpolation", "InterpolationOffset", "Parcel" or "Rooftop".

For address "41, Kraeizgaass (Et. RC) L - 9807 Hosingen" however I keep getting

"calculationMethod": "",

in the JSON response, using API version 2025-01-01.

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
{count} votes

1 answer

Sort by: Most helpful
  1. IoTGirl 3,831 Reputation points Microsoft Employee Moderator
    2025-10-29T21:34:41.34+00:00

    You are not using "Address Line" as documented and it found nothing that matched so an empty collection should be expected. It, addressLine, should not have the postal code or city. There are other fields for those. "Address Line" is part of a structured call not a query call and you are putting too much into the address line so nothing will match.

    See the structure here: GET https://atlas.microsoft.com/geocode?api-version=2025-01-01&top={top}&query={query}&addressLine={addressLine}&countryRegion={countryRegion}&bbox={bbox}&view={view}&coordinates={coordinates}&adminDistrict={adminDistrict}&adminDistrict2={adminDistrict2}&adminDistrict3={adminDistrict3}&locality={locality}&postalCode={postalCode}

    So you should review https://learn.microsoft.com/en-us/rest/api/maps/search/get-geocoding?view=rest-maps-2025-01-01&tabs=HTTP#uri-parameters

    You would use parameters like "addressLine=41%20Kraeizgaass&countryRegion=Luxembourg&postalCode=L-9807&locality=Hosingen" to narrow the search results to the regions within the address.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.