public class Geocoder
extends Object
Geocoder provides an interface to lookup positions based on place names, postcodes, grid references, roads, or any
combination thereof.
It operates on either/both an offline database which is provided with the SDK or Ordnance Survey online services
OSGeocoder is not thread-safe, and is not reentrant. It must only be called from a single thread, and only one geocoding
operation can be run at any one time. Clients should use cancelGeocode to cancel online searches, and not issue requests
while isGeocoding returns YES.
The search always returns a (possibly empty) array of objects derived from OSPlacemark objects. Any matching roads are
returned as OSRoad objects.
A search of type OSGeocodeTypeOnlinePostcode or OSGeocodeTypeOnlineGazetteer will use the appropriate Ordnance Survey
online service to fetch results.
A search of type OSGeocodeTypeGazetteer will return matching place names. These will be ordered by the type of place;
Cities will be returned before Towns, and Towns before other features.
A search of type OSGeocodeTypeGridReference will treat the search term as an OS Grid Reference. It will return up to one
result. A valid search term consists of two letters as per the [OS National Grid Square convention][https://www.ordnancesurvey.co.uk/oswebsite/gps/information/coordinatesystemsinfo/guidetonationalgrid/page9.html]
followed by 0,2,4,6,8 or 10 digits. Invalid search terms (not matching this format, or containing invalid letter
sequences) will return no results.
A search of type OSGeocodeTypeRoad will return roads matching the search term. If none are found, then the search term
will be split into a road and a location. If a comma is present in the search term, the split will be made there,
otherwise the split is carried out automatically. The search will then return roads near matching locations.
OSGeocoder allows searches to be carried out with a range. The behaviour of this range varies.
A search over multiple types (for example Gazetteer and Road) will search for entries of the specified types that
match the search string. These results will be ordered by result type.
The range field is honoured for searches of type OSGeocodeTypeGazetteer and OSGeocodeTypeRoad, but ignored for all
other types of search. A search combining multiple types will honour the range field where it can, but will apply the
range individually to each result set, so a combined search with a range of
(NSRange){0,100}
may return 100 gazetteer entries AND 100 roads.