Bing Maps Local Search API - More Locations are Returned as I Zoom Into an Area

Ken Bowman 106 Reputation points
2023-06-05T20:00:30.3433333+00:00

Hi,

I'm using the Bing Maps Local Search API (i.e., https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/local-search) with a defined userMapView and am wondering why, with the following query, I receive more location results as I zoom into an area?

https://dev.virtualearth.net/REST/v1/LocalSearch/?query=Motorcycle%20Dealers&userMapView=46.263387,-125.651855,49.156510,-119.543457&maxResults=25&key=mySessionKey

Returns 7 locations

Zoom into the same area and more results are returned:

https://dev.virtualearth.net/REST/v1/LocalSearch/?query=Motorcycle%20Dealers&userMapView=47.367145,-123.361206,48.090410,-121.834106&maxResults=25&key=mySessionKey

Returns 18 locations

I would have expected at least 18 locations returned by the first query, or 7 or fewer returned by the second query, as the bounding box in the second query is entirely contained with the bounding box defined in the first query.

Thanks,

Ken

Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
253 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. IoTGirl 3,051 Reputation points Microsoft Employee
    2023-06-06T21:42:03.89+00:00

    Hi Ken,

    I have reached out to the engineering team on this but I suspect context comes into play here with your first set of co-ordinates including both Canada and the US (With one co-ordinate in the ocean) and the second set being all in Washington state and no co-ordinate in the water.

    Bing has a Location Knowledge Graph that builds a location understanding for the query and this context is sensitive to the contexts I mentioned already. This likely is the source of the change in data set for the two views.

    Sincerely,

    IoTGirl

    0 comments No comments

  2. Ken Bowman 106 Reputation points
    2023-06-06T23:52:29.74+00:00

    This example is entirely within the state of Colorado:

    https://dev.virtualearth.net/REST/v1/LocalSearch/?query=Motorcycle%20Dealers&userMapView=37.412582,-108.656006,40.750256,-102.426758&maxResults=25&key=mySessionKey

    Result: 3 Locations

    This example zooms into Denver and gets many more locations:

    https://dev.virtualearth.net/REST/v1/LocalSearch/?query=Motorcycle%20Dealers&userMapView=39.318770,-105.831146,40.145691,-104.273834&maxResults=25&key=mySessionKey

    Results: 22 Locations

    This example zooms further into Denver and gets a couple more locations:

    https://dev.virtualearth.net/REST/v1/LocalSearch/?query=Motorcycle%20Dealers&userMapView=39.526430,-105.441818,39.939891,-104.663162&maxResults=25&key=mySessionKey

    Results: 24 Locations

    I was hoping that I could show a message to my users that they need to zoom in when the number of locations returned was equal to the maximum (i.e., maxResults=25).

    How would I create an interface to communicate what "context" is required so that a user could know that they have actually plotted all local entities for an area meeting the query/search string criteria? Alternatively, is there a zoom level that would assure that all entities (or the max) are retrieved for an area?

    Thanks,

    Ken