Restrict Location Search by Bounding Box

Background

Location search is very difficult to get right. One reason for this is there are a lot of duplicate names for cities, regions, towns and other places. For example, take a query like doctors in canton. In the US alone there are 4 cities named Canton (Ohio, Michigan, Georgia, and Massachusetts). So which Canton is the user looking for?

Answers will automatically use the users’ location and place popularity to try and figure this out but sometimes that’s not enough.

While there isn’t a one size fits all solution for this problem, for a company like IHA (a regional hospital located in Michigan) the preferred Canton is obvious - it’s Canton, Michigan. All of their doctors and locations are located in Michigan so it’s extremely unlikely that someone would be looking for Canton Mass even if they were searching from New Hampshire.

Introducing Bounding Box

Bounding Box is a new configuration option that tells Answers to only search for locations within a specified rectangle (a.k.a. bounding box). For any business that is local, a bounding box is recommended to improve the accuracy of location search.

Note: If a business has entities across a country or across the world, this configuration option will not help and should not be used.

A new top-level property named boundingBox can now optionally be set on an experience configuration. It applies to all Verticals and to both Universal and Vertical search. It is set at the experience level.

Here is an example for IHA:

{
  "name": "IHA Answers",
  "boundingBox": {
    "minLatitude": 41.4054,
    "minLongitude": -85.1803,
    "maxLatitude": 43.3513,
    "maxLongitude": -81.4989
  },
}

Now when I search for doctors near canton from New York City, Answers knows to use the right Canton!

Finding the right Bounding Box

In order to get the right lat/lng to specify, you can use a tool like http://bboxfinder.com/. Specify a rectangle and then use it to get the lat/lng of each corner. You should make sure to make the rectangle big enough to encompass all locations and nearby POI but also small enough to improve the location accuracy.

In the future, we plan on making it easier to find the right Bounding Box based on the entities in the Knowledge Graph.

Please let us know if you have any questions.

Hey Max,

I have a question about best practices here - I have a client whose locations are all in the U.S. and are fairly spreadout (NJ → TX), but they don’t have any locations on the West Coast. I’ve found Bounding boxes to be really helpful with location search, so I was wondering if it was a good idea to create a very large bounding box across 2/3 of the country (exclude the West Coast).

I understand that this could be potentially problematic if they expand into new territories, so might not be the best idea. What do you think?

Hypothetically, if they were only in NJ and TX, do we (or would we ever) support multiple different bounding boxes (one for NJ and one for TX)? Just curious!

Hey @jyorke,

A big bounding box is certainly not going to hurt so if you are running into issues where places in the West Coast are causing location issues a bounding box might help.

We do not have plans to add multiple bounding boxes but we are working on a feature that essentially automatically draws bounding boxes around the locations in the Knowledge Graph. So this would happen automatically and would adapt to the locations in the Knowledge Graph. We hope to have this out in the next month so stay tuned!

Max

That sounds awesome! Thanks Max, this was helpful.