Reset Password

Your search results

Location, Location, Location

Published on 12th January 2017 by Essence

How to define property locations and use those locations in searches is far from a trivial exercise, and many large listing sites get it completely wrong.

This article describes how it is done in OwnerHolidays, and what improvements are planned.

OwnerHolidays locations are based on what is provided by the Google Maps API. Google is not perfect, but is better than anything else, and is a good starting point.

You can play with Google Maps using

https://google-developers.appspot.com/maps/documentation/utils/geocoder/

This allows you to type in a location, or click on the map, and it will show the location breakdown for that location. The location breakdown is a hierarchy, or nearly so. Not all levels are available for every location.

The elements of the hierarchy which OwnerHolidays uses, where defined, is:

Country
administrative_area_level_1
administrative_area_level_2
administrative_area_level_3
administrative_area_level_4
neighborhood
locality

I am also considering adding ‘postal_town’ to the hierarchy, as an example recently reported by an owner in the Peak District may make this useful.

An example, for a location with which I am familiar but is probably not a priority for holiday travellers, you can have:

United States -> Texas -> Harris County -> Houston -> Westside

Another example, where I have stayed on holiday, is:

Portugal -> Faro -> Vila do Bispo -> Budens

Search by area

An overall location hierarchy is created by amalgamating each individual property location hierarchy, and this overall location hierarchy is used under the ‘area’ tab of the search widget on the website. You will always be able to find your property under that area tab hierarchy. Some properties may be at strange locations (e.g. middle of Atlantic Ocean), but that is because the owner has not defined the lat/long.

 

Search by city

In addition to the search by area, there is a search by city. A list of cities is derived from individual properties. ‘City’ is not a concept known to Google, so it is chosen from other elements depending on what is available.

Search by location

The third way of searching, which is normally the only method in other listing sites, is by typing in a location. This can be tried by typing in the location on the above link. For example, typing in Newquay returns:

Newquay-> Cornwall -> England -> United Kingdom

Typing Algarve returns:

Portugal -> Faro District

Typing New Forest returns:

United Kingdom -> Hampshire -> New Forest District

Typing Cotswolds returns:

United Kingdom -> England -> Gloucestershire

whereas Cotswolds District returns:

United Kingdom -> England -> Gloucestershire -> Cotswold District

At present in OwnerHolidays, a search on the locaton tab compares the hierarchy of locations returned by Google against the hierarchy for individual properties. Clearly this is not 100% reliable. An alternative which we will be looking at is to use the bounding box returned by Google.

If you type Cotswolds District, Google will return the bounding box corner coordinates:

52.11258,-1.615202 — 51.577536,-2.323604

so it is possible to search for all property lat/longs within that box.

Complications

There are some other difficulties. There are some informal names, which Google may not use, or only partially. For example, Google does not know about ‘South West England’. You can type ‘Algarve’ into Google, but it will return Faro District, not Algarve.

In the above examples, we insert these informal names into the hierarchy returned by Google, so that they can be used in searches. Whenever Cornwall is encountered, ‘South West England’ is inserted. This will inevitably be a continual process adding informal names programmatically.

There are language issues. Do we use French or English spellings? What about accents? is it Normandy or Normandie? Even Google does not seem to be consistent on this.

For example, if you type in Brittany or Bretagne, in both cases Google will return Brittany. But if you click on a map, it will return Bretagne. This reinforces the need to do searches based on lat/long bounding boxes.

When an owner enters a property, the essential data is the lat/long, from which everything else is derived. The country, area and region is filled out automatically, and cannot be changed. If they were changed, it would disrupt the search methods, and introduce inconsistencies. However, we can see that some tweaks are necessary. For example, address and postcode could be changed by the owner, because they are not used in searches.

There may also be value in allowing owners to enter their own search keywords, but the hope is that this is not necessary once the above improvements have been implemented.

Overall, there have been significant improvements since the initial website release. a new and unique hierarchical search facility is available, and once some further glitches have been ironed out and a bounds-based search implemented, we will be in good shape to cater for a large number of properties worldwide with minimal support effort.

Category: Website

Leave a Reply