Perform a geocode search near a geographic coordinate.
#include <geo_search.h>
geo_search_error_t geo_search_geocode_latlon(geo_search_handle_t *handle, geo_search_reply_t *reply, const char *search_string, double lat, double lon)
BlackBerry 10.0.0
A geo_search handle.
A reply handle.
A null-terminated free format search string (UTF-8).
Latitude in decimal degrees of the geographic coordinate to search near. This must be specified using the WGS84 datum.
Longitude in decimal degrees of the geographic coordinate to search near. This must be specified using the WGS84 datum.
Given a free form string specifying a location and a geographic coordinate, this function provides a reply containing one or more matching results. If the location specified is a complete street address, the reply may contain only one result. If the location given is less specific (e.g. "Springfield"), then there may be multiple results in the reply. The results will be sorted in order of proximity to the specified geographic coordinate. Note that even with a geographic coordinate provided as a hint, it is still possible that no results are found (this function returns GEO_SEARCH_ERROR_SERVER_EMPTY).
Note that this function may make a network request and will block until the remote server responds.
geo_search_handle_t handle; geo_search_error_t error = geo_search_open( &handle ); if ( error == GEO_SEARCH_OK ) { geo_search_reply_t reply; const char *search_string = "Springfield"; double lat = 39.8017; double lon = -89.6436; error = geo_search_geocode_latlon(&handle, &reply, search_string, lat, lon); if ( error == GEO_SEARCH_OK ) { // do something with the results in the search reply geo_search_free_reply( &reply ); } geo_search_close( &handle ); }
See geo_search_reply_get_name() for an example of how to access the results in a search reply.
GEO_SEARCH_OK if successful, otherwise one of the values from geo_search_error_t.