5

When I search for any sizeable location in Google, the results page includes a sidebar with information about that city, and often includes a list of Points of Interest:

enter image description here

If I click the 'View 15+ More' link, I get a scrollable view with lots more:

enter image description here

Is there any way to get these places (or similar) via the Places API? You can do nearby, text and radar searches based on a location, and you have to specify a single type (from this list), or you can use a types array for several at once, but it is deprecated.

My main problem is that the Places API gives you a pretty mixed bag of results, often not particularly relevant or noteworthy. And how do you select just the right types, and get the best attractions? Whereas Google's own results pages have a very good selection of the top attractions.

For instance doing a nearby search, if I omit the type parameter, I mostly just get a list of hotels for central London:

function initialize() {
 var centre = new google.maps.LatLng(51.506974, -0.127488);

 var map = new google.maps.Map(document.getElementById("map"), {
  zoom: 15,
  center: centre,
  mapTypeId: google.maps.MapTypeId.ROADMAP
 });
 
 var service = new google.maps.places.PlacesService(map);
 
 service.nearbySearch({
  location: centre,
  radius: 1000
 }, function (results, status) {
  if (status === google.maps.places.PlacesServiceStatus.OK) {
   for (var i = 0; i < results.length; i++) {
    console.log(results[i].name);
   }
  }
 });
}

google.maps.event.addDomListener(window, 'load', initialize);
 
html, body, #map { width: 100%; height: 100% }
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places"></script>

<div id="map"></div>

This returns:

  • London
  • The Trafalgar Hotel
  • Citadines Trafalgar Square London
  • Corinthia Hotel London
  • Amba Hotel Charing Cross
  • Haymarket Hotel
  • The Royal Horseguards
  • Sofitel London St James
  • Radisson Blu Edwardian, Hampshire
  • every hotel Piccadilly
  • Premier Inn London Leicester Square
  • W London Leicester Square
  • The Savoy
  • Strand Palace Hotel
  • Le Méridien Piccadilly
  • Piccadilly Guest House
  • The Cavendish London
  • The Z Hotel Soho
  • The Grand At Trafalgar Square
  • Soho

If I add type: ['museum'] to the request, I get this fairly random list instead. The first 5 or so aren't bad, then it goes a bit awry:

  • Churchill War Rooms
  • The National Gallery
  • National Portrait Gallery
  • London Transport Museum
  • The Courtauld Gallery
  • London Film Museum
  • Jewel Tower
  • 19 Greek Street
  • Spencer House Ltd
  • The Household Cavalry Museum
  • Whitfield Fine Art (art dealer)
  • ICA Bar & Cafe
  • Anatomy Museum
  • Max Rutherston Ltd (art dealer)
  • Hazzlitt Holland-hibbert (art dealer)
  • Fossils London (shop)
  • London Original Print Fair (name of a temporary exhibition)
  • Diana's Dresses (name of a temporary exhibition)
  • English Heritage
  • الطرف الاغر (translated: "Trafalgar")

Alternatively any 3rd party API which might have similar (but better) results could be useful.

duncan
  • 31,401
  • 13
  • 78
  • 99
  • What exactly feels random about the museum list? Apart from the last entry, which is somehow linked to the Battle of Trafalgar, that is. Everything listed is essentially a museum. – xnakos Jun 06 '16 at 14:36
  • @xnakos for instance "Max Rutherston Ltd" is an antiques dealer, not a museum. "Fossils London" is a shop, not a museum, etc. And some of the items which are tenuously museums, aren't on the list of what I'd expect to get in the top 20 for this area of London. – duncan Jun 06 '16 at 14:51
  • 1
    You are right. The examples you mentioned seem like shops who have a showroom. I am not sure how the "museum" place type crept in as a place type of theirs. But it was probably because of the owners managing the Google Place entry and choosing the specific place type. Since the default "prominence" metric is used for ranking, the calculation of which is vague, these places may have gone up because of having a SEO specialist in their ranks, pushing the website up. These are assumptions, I guess. But looking for POIs the way you mean to, something does not feel right using Google Places. – xnakos Jun 06 '16 at 15:13
  • 1
    Maybe you could look into Foursquare. There is real tree-like categorization (not tag-like, as in Google Places) supporting multiple category search, also offering an explore function (which I haven't used, but seems to provide popular venues belonging to some categories). Google Places has deprecated multiple-place-type search. Also, note that 'point-of-interest' and 'establishment' are present as place types in all GP search results (I can tell you that, after scanning a large area that returned ~200k places - the same area returned ~100k venues for Foursquare, to give you a perspective). – xnakos Jun 06 '16 at 15:24
  • ;) If better results come along, please share! – xnakos Jun 06 '16 at 15:34

0 Answers0