HERE Geocoder Autocomplete API missing results compared to Geocoder API - autocomplete

I am trying to implement an input box for building names in Hong Kong that autosuggest as the user is typing.
Naturally Geocoder Autocomplete API would seem to be the obvious choice. But having done some testing, I found that the results returned from Geocoder API to be more accurate and comprehensive. Geocoder API also returns more results and to a better granularity.
For instance, building names that correctly resolve to Match level - houseNumber on Geocoder API, are resolving to street level on Geocoder Autocomplete API. Plus a lot more relevant results are returned for Geocoder API.
So my thoughts are to use Geocoder API over Geocoder Autocomplete API, but this appears to render the Autocomplete API a bit redundant.
Can anyone advise whether there are any advantages to using Geocoder Autocomplete API over Geocoder API?
At the moment, I can't see any point in using the Autocomplete API given it's lower level of accuracy and missing results.

The HERE Geocoder Autocomplete API does a best match based on your input parameters and also limits the number of returned suggestions to a maximum of 20. If you think you need more results and that the HERE Geocoder API itself returns more relevant results for your use case then there is no problem using it.

Related

Building a City/Country Search box. Can Bing API support this?

I'm currently building a search box for a mobile app that can search for a Country/ State/ Country. I'm currently looking for APIs that can support this... An option for me would be the Google Places API but as much as possible I don't want to use Google for my project.
So before I import the Bing SDK into my project, I'm curious if anyone knows if this is possible with Bing API.
With Bing Maps you can use the location query API: https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query however, it will also find addresses if you pass them in. Generally though, if you type just a state or country, this API will return the expected result. You can add a bit of code to look through the results and filter them based on their entity type if required.
Since you tagged Azure Maps, you can use the Azure Maps address search API: https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address It has filtering parameters available that might be better suited for this scenario.

POI not found with geocoding API

I am trying to use the MapBox Geocoding API and for it I tried to translate "Centre Hospitalier Régional d'Orléans" (that is an Hospital in France, Orléans) into Lng/Lat coordinates.
When I display a MapBox Map, I can see the POI:
And when I click it in MapBox Studio, it is well recognized as a Point Of Interest (POI) (poi-label):
But when I try to find it using the Geocoding API, I don't find it.
Here is the request I run:
https://api.mapbox.com/geocoding/v5/mapbox.places/Centre%20Hospitalier.json?access_token=pk.eyJ1IjoibWF0dGZpY2tlIiwiYSI6ImNqNnM2YmFoNzAwcTMzM214NTB1NHdwbnoifQ.Or19S7KmYPHW8YjRz82v6g&cachebuster=1547469044480&autocomplete=true&country=fr&proximity=1.909251%2C47.902964
Is it normal ? Am I doing something wrong or is it a bug ?
The data behind the maps and the geocoder aren't necessarily the same, so it's likely this Hospital is showing up on the map from OpenStreetMap, but isn't in the data being used for the geocoder.
Some information about data sources is at https://www.mapbox.com/about/maps/
You can report feedback about this at https://apps.mapbox.com/feedback/ mentioning its a geocoding issue.

Google Geocoding API: number of results

Is there a way to increase the number of results returned by Google Geocoding API. Right now the default seems to be 10, however it does not seem to include the intended result.
Thanks
Getting more results from the Geocoding API is not necessarily a solution. And no, can't get more.
Instead, you may want to use the Places Autocomplete API, or the Places library in the Maps JavaScript API. Specially when bound to a map, it makes it much easier for users to find places.

List / database of valid addresses for geolocation / geospatial testing

I'm running some geospatial tests to demonstrate use of the MongoDB geo APIs. The problem is that I don't have a list of valid addresses with which I can test.
The idea is to query the latitude and longitude through Bing Maps as my sample application is a job search website where the locations I will be indexing to query against would be entered as listing for new job opportunities and would be entered using addresses rather than latitude and longitude coordinates.
Any help would be much appreciated!
I don't suspect Microsoft provides a list of fake locations that will register to valid lat/long coordinates on Bing (for this exact purpose or similar), but if they do...that would be equally acceptable.
FWIW, I did thoroughly check Microsoft's documentation and found nothing on this.
Alternatively, I could just query common places like Starbuck's or POI's (probably what I'll end up doing), but it would be nicer if there were a testing mode where you could use addresses that would register with Bing. Microsoft, in case you happen to subscribe to Stack Overflow tags, I would post this suggestion on the Bing community forums but there is no way to post an answer or question there, please fix this.
Decided just to use the Bing Maps API to query some popular companies although this is not ideal.

Integrate Google Maps API into an iPhone app

Update: iPhone SDk 3.0 now addresses the question here, however the NDA prevents any in depth discussion. Log in to the iPhone Dev Center if you need more info.
Ok, I have to admit I'm a little lost here.
I am fairly comfortable with Cocoa, but am having trouble picking up the bit of javascript needed to solve this problem.
I am trying to send a request to Google for a reverse geo code.
I have looked over the Google documentation I have viewed here:
http://code.google.com/apis/maps/documentation/index.html
http://code.google.com/apis/maps/documentation/geocoding/
Even after a rough reading, I am missing a basic concept:
How do I talk to google? In some examples, they show a url being sent to google (which seems easy enough), but in others they show javascript. It seems for reverse geocoding, the request might be be harder than sending the url with some parameters (but I hope I am wrong).
Can someone point me to the correct way to make a request? (In objective-C, so I can wrap my head around it)
UPDATE - iPhone 0.3 includes MapKit, which will hopefully be significantly faster than using the JS API. The blurb says that it will include reverse geocoding.
You can't make a request directly in objective-C, at least not within the terms of the Google API. The Google API is written in Javascript. You could use an objective-c to JS bridge, as the Google Maps Component does, but that doesn't really solve the issue - you're still making JS calls!
Unfortunately, that means you
a) need to use a webview
b) need to use the JS API which is slow... compare with the Google Maps application which uses a completely different OTA protocol (try packet sniffing it).
The Google Maps Component is, however, a useful tutorial in how to make simple calls to the API.
I have created SVGeocoder, a simple forward and reverse geocoder class for iOS. It uses the Google Geocoding API, returns SVPlacemark objects (an MKPlacemark subclass with a coordinate property) and uses blocks.
This is how you geocode an address string:
[SVGeocoder geocode:addressString
completion:^(NSArray *placemarks, NSError *error) {
// do something with placemarks, handle errors
}];
You can also reverse geocode a coordinate like this:
[SVGeocoder reverseGeocode:CLLocationCoordinate2DMake(45.53264, -73.60518)
completion:^(NSArray *placemarks, NSError *error) {
// do something with placemarks, handle errors
}];
The easiest way to get a Google map using Cocoa is to use the "Static Maps API". In practice, you need to prepare an NSURL that you use to contact Google. You get back your map as NSData, that you transform to an NSImage. Note that you can do both geocoding and reverse geocoding. You can also embed markers on the map. However, you loose the full controls you have access to if you use their JavaScript API.
Take a look at their reference guide here:
http://code.google.com/apis/maps/documentation/staticmaps/
Now that apple have release the MapKit API for OS 3.0, I think your question has been answered. Having looked at the API docs, I can see a heck of a lot of potential! I still would like to see reverse geocoding webservice from Google, but Yahoo will do in the meantime.
For your information: The reverse geocoding API from Google for requests by XML isn't public, so it's illegal to use. The only legal way is going through their JavaScript-API, which as you found out is harder to do in Cocoa than to simply send an HTTP request.
Alternatives: Reverse geocoding with simple XML/JSON requests is also available from Geonames or Yahoo.
Since iOS5 we have the following options as stated in the development doc:
* "A geocoder object uses a network service to convert between latitude and longitude values and a user-friendly placemark, which is a collection of data such as the street, city, state, and country information. Reverse geocoding is the process of converting a latitude and longitude into a placemark. Forward geocoding is the process of converting place name information into a latitude and longitude value. Reverse geocoding is supported in all versions of iOS but forward geocoding is supported only in iOS 5.0 and later."*
You can now use a CLGeocoder object.
Also try to take a look at google maps component.
Actually, I did not meant reverse geocoding as "translating a point into a human-readable address", but rather visualizing a point using a Google Map (that can also, depending on the accuracy level, show a human-readable address). This is the basic functionality that was required.
In practice, I just wanted to suggest the static maps API as a clean and fast way to:
1) given the coordinates obtained from the iPhone GPS sensor, retrieve a Google Map showing the point
2) given an address, transform it in the corresponding geographical coordinates and then use the coords to retrieve a Google Map showing the address given
Both are possible using simple NSURLs involving the staticmap and geo services
http://maps.google.com/staticmap?
http://maps.google.com/maps/geo?
passing of course the needed parameters to provide a suitable query string.
Kind regards
The big issue of course, is that the license agreement of both google and yahoo state you can't use these API's in "commercial applications". would hate to pub an app on the app store only to have it taken down and sued by yahoo or google. In reading the iPhone 3.0 map api and associated license this isn't mentioned but if you want an app to run on phones not upgraded....
Is there an answer for this that won't get one in trouble?
http://blog.cloudmade.com/2009/06/12/how-to-get-forward-geocoding-in-iphone-mapkit/
CloudMade seems to be an open-source map/location provider - the above blog post lists details on how to get forward geocoding.