Class Geocoder
- Namespace
- TimeCockpit.Data.Geolocation.OSM
- Assembly
- TimeCockpit.Data.dll
Geocoder utilizing openstreetmap services.
public class Geocoder
- Inheritance
-
ObjectGeocoder
- Inherited Members
-
Object.ToString()Object.Equals(Object)Object.Equals(Object, Object)Object.ReferenceEquals(Object, Object)Object.GetHashCode()Object.GetType()Object.MemberwiseClone()
Constructors
Geocoder(String)
Initializes a new instance of the Geocoder class.
public Geocoder(string nominatimBaseUri)
Parameters
nominatimBaseUriStringBase uri for nominatim service. e.g. http://open.mapquestapi.com/nominatim/v1/search.php?
Properties
UserAgent
Gets or sets the optional, custom user agent.
public string UserAgent { get; set; }
Property Value
- String
Methods
GetCoordinatesWithFallback(Address)
Match an address to a location with stepwise fallback.
public FallbackMatch GetCoordinatesWithFallback(Address address)
Parameters
addressAddressOriginal/actual address.
Returns
- FallbackMatch
Match using fallback.
Remarks
The fallback algorithm tries to drop parts of the address to achieve a positive lookup result. e.g. first omit city string, omit street number ...
TryGetLocation(Address, out Location)
Attempt to look up a location for the provided address.
public bool TryGetLocation(Address address, out Location location)
Parameters
Returns
- Boolean
True if the lookup was successful.
TryGetLocations(Address, Int32, Boolean)
Attempt to look up a location for the provided address.
public List<Location> TryGetLocations(Address address, int maxItems, bool alternativeQuery = false)
Parameters
addressAddressLookup address.
maxItemsInt32Maximum number of items to return.
alternativeQueryBooleanIndicates whether the alternative/split query parameter format is used.
Returns
- List<Location>
List of found items.