GooglePlacesAutocompleteAdapter (Android Places API) returning results outside of boundary - autocomplete

It seems that the sample code from Google that demonstrates the Google Places API for Android is returning results from outside of the given boundary. (https://github.com/googlesamples/android-play-places/).
Searching for 'hardware' shows most results from Sydney (the hardcoded boundary), but also (occasionally) shows results from as far away as other cities (including Western Australia!). I've implemented GooglePlacesAutocompleteAdapter in my own code and have found similar results. It seems that the Boundary field is only a guideline for the search; can anyone confirm this?
This may or may not be related, but does anyone know also whether the results returned from Places.GeoDataApi.getAutocompletePredictions are the same results that can be expected from a similar call to the Web Services Places API? With a few tests it seems the web services call returns better results (closer to location, more relevant, and overall more results). The API docs do not seem to shed any light on this -- my guess is perhaps the getAutocompletePredictions query is performed on the 'name' of the Place rather than in a 'keyword' search as per the web service API implementation.
Thanks for the help.

As per the developer docs, the bounds is...
for geographically biasing the autocomplete predictions.
This means exactly what you suggested. Results inside are preferred, but not required.

Related

Bing Maps API returning different values to website

The API seems to be giving different values to the maps website.
Here is the front-end output for travelling between Manchester Airport and the London Eye.
Here's the API output
As you can see the numbers are close, but since they should both be calling the same thing, I'm confused as to the difference?
I need to use this to work out the time between close proximity places, so a couple of minutes matters here.
This is the api url I'm using:
https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=53.361881,-2.270841&destinations=51.49984,-0.124663&travelMode=driving&timeUnit=minute&distanceUnit=mi&key={insertkey}
Does anyone have any ideas what I'm doing wrong?

Searching MKMapview using JSON tends to return no results, or an incorrect one

I have an iphone app (iOS 5) that uses a UISearchBar to search an MKMapView. We used JSON queries, and used the fantastic answers from this question as reference (our code is very similar). The process itself works fine now, but we tend to get no results back from Google when we query them, or just get a really far away and incorrect one. Most times we can even search for "McDonald's" or "Subway" at it won't return any results. In general, it rarely gives a good result back unless we're very specific and include city and state and everything.
Is there another better way to go about this? Has something been updated since that answer that we should now take in to account? The problem doesn't seem to be that the code isn't working, but rather that Google just doesn't handle queries well the way we do it. This seems to be a fairly common use for MKMapview so I figured there should be an easier and better-working solution.
Any help would be much appreciated.
Here is a very useful list of the parameters that the Google Maps API supports:
http://querystring.org/google-maps-query-string-parameters/
You have a couple of options:
1) Get the user's location from the app and pass it into the search query with the sll parameter, e.g.
this search doesn't include a location:
https://maps.google.com/?q=starbucks
but this one does (I've used San Francisco in this example):
https://maps.google.com/?q=starbucks&sll=37.776414,-122.437477
Then you'll get results for the user's actual location. You'll also need to do something sensible if the user does not permit the app to access their location (in that case you may want to disable search).
2) If your app is for a specific place, then you can just add that place on the end of your search string. e.g. my Domesday app is only for England, so I include ",England" on the end of all my search requests, and that works nicely for me.

How does Facebook search work?

More specifically, what factors determine the priorities they assign in response to a given query? I'm looking for answers that address numerous scenarios including queries that...
Specify the "type" of result (objects such as users, posts, pages, etc. or connections like friendships, likes, tags, etc.),
Have authentication tokens as well as ones that don't.
Have conditionals such as "since" and "until."
Don't even specify a type, such as this search for the word query.
I am actually working on an app that uses /search to search places and I use a bit of all scenarios. I couldn't write down a specific order they appear in and to be honest I highly doubt it's something as easy.
I'm 99% sure it works like the Search in Facebook does, using the user data to bring up the most relevant results. I live in Ireland for 2 years now, but while testing the app I constantly receive search results from Romania and actually close to my Hometown, which are relevant to me.
Regarding your observations, Facebook's algorithms might take into account the source of the request as well - which would be good, means it only improves as your app gets more users.

Geolocation APIs: SimpleGeo vs CityGrid vs PublicEarth vs Twitter vs Foursquare vs Loopt vs Fwix. How to retrieve venue/location information?

We need to display meta information (e.g, address, name) on our site for various venues like bars, restaurants, and theaters.
Ideally, users would type in the name of a venue, along with zip code, and we present the closest matches.
Which APIs have people used for similar geolocation purposes? What are the pros and cons of each?
Our basic research yielded a few options (listed in title and below). We're curious to hear how others have deployed these APIs and which ones are ultimately in use.
Fwix API: http://developers.fwix.com/
Zumigo
Does Facebook plan on offering a Places API eventually that could accomplish this?
Thanks!
Facebook Places is based on Factual. You can use Factual's API which is pretty good (and still free, I think?)
http://www.factual.com/topic/local
You can also use unauthenticated Foursquare as a straight places database. The data is of uneven quality since it's crowdsourced, but I find it generally good. It's free to a certain API limit, but I think the paid tier is negotiated.
https://developer.foursquare.com/
I briefly looked at Google Places but didn't like it because of all the restrictions on how you have to display results (Google wants their ad revenue).
It's been a long time since this question was asked but a quick update on answers for other people.
This post, right now at least, will not go into great detail about each service but merely lists them:
http://wiki.developer.factual.com/w/page/12298852/start
http://developer.yp.com
http://www.yelp.com/developers/documentation
https://developer.foursquare.com/
http://code.google.com/apis/maps/documentation/places/
http://developers.facebook.com/docs/reference/api/
https://simplegeo.com/docs/api-endpoints/simplegeo-context
http://www.citygridmedia.com/developer/
http://fwix.com/developer_tools
http://localeze.com/
They each have their pros and cons (i.e. Google Places only allows 20 results per query, Foursquare and Facebook Places have semi-unreliable results) which can be explained a bit more in detail, although not entirely, in the following link. http://www.quora.com/What-are-the-pros-and-cons-of-each-Places-API
For my own project I ended up deciding to go with Factual's API since there are no restrictions on what you do with the data (one of the only ToS' that I've read in its entirety). Factual has a pretty reliable API, which as a user of the API you may update, modify, or flag rows of the data. Facebook Places bases their data on Factual's, just another fact to shed some perspective.
Hope I can be of help to any future searchers.
This is not a complete answer, because I havn't compared the given geolocation API, but there is also the Google Places API, which solves a similiar problem like the other APIs.
One thing about SimpleGeo: The Location API of SimpleGeo supports mainly US (and Canada?) based locations. The last time I checked, my home country Germany doesn't has many known locations.
Comparison between places data APIs is tough to keep up to date, with the fast past of the space, and with acquisitions like SimpleGeo and HyperPublic changing the landscape quickly.
So I'll just throw in CityGrids perspective as of February 2012. CityGrid provides 18M US places, allowing up to 10M requests per month for developers (publishers) at no charge.
You can search using a wide range of "what" and "where" (Cities, Neighborhoods, Zip Codes, Metro Areas, Addresses, Intersections) searches including latlong. We have rich data for each place including images, videos, reviews, offers, etc.
CityGrid also has a developer revenue sharing program where we'll pay you to display some places as well as large mobile and web advertising network.
You can also query Places via the CityGrid API using Factual, Foursquare and other places providers places and venue IDs. We aggregate data from several places data providers through our system.
Website: http://developer.citygridmedia.com/

Parsing Google's search results

I'm "working" on a data mining project and I've chosen to parse Google search results. Now before I actually start, I want to consult you - experienced folks.
I did a bit of research on how Google delivers results and I analyzed structure of a result page. That's all alright, I've already figured out regexes and data structures I'll use.
In between I encountered their CAPTCHA because I was searching too fast; oh, the irony. I've also discovered that they limit results to 1000 actually. Now, is there any way I could avoid those peripeties, perhaps slowing the rate of url fetching to solve the first one or reporting when encountering CAPTCHA so that it waits for my input; that might do it, but what about the other one ? Does Google provide some kind of an API that I can use for a workaround? I couldn't find one on their code.* page.
There is a Custom Search API.
It returns results in json or XML, so you won't even need to use regexes. However, you do need to pay for more than 100 searches a day.
What exactly are you trying to do? Maybe there is a better way to accomplish it.
Always look on CPAN first!
https://metacpan.org/pod/REST::Google
If someone hasn't already solved your problem, chances are it's a weird one :-)