Class Geocoder
Geocoder utilizing openstreetmap services.
Inheritance
Inherited Members
Namespace: TimeCockpit.Data.Geolocation.OSM
Assembly: TimeCockpit.Data.dll
Syntax
public class Geocoder
Constructors
Geocoder(String)
Initializes a new instance of the Geocoder class.
Declaration
public Geocoder(string nominatimBaseUri)
Parameters
Type | Name | Description |
---|---|---|
System.String | nominatimBaseUri | Base uri for nominatim service. e.g. http://open.mapquestapi.com/nominatim/v1/search.php? |
Properties
UserAgent
Gets or sets the optional, custom user agent.
Declaration
public string UserAgent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GetCoordinatesWithFallback(Address)
Match an address to a location with stepwise fallback.
Declaration
public FallbackMatch GetCoordinatesWithFallback(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | Original/actual address. |
Returns
Type | Description |
---|---|
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.
Declaration
public bool TryGetLocation(Address address, out Location location)
Parameters
Type | Name | Description |
---|---|---|
Address | address | Lookup address. |
Location | location | Found location. |
Returns
Type | Description |
---|---|
System.Boolean | True if the lookup was successful. |
TryGetLocations(Address, Int32, Boolean)
Attempt to look up a location for the provided address.
Declaration
public List<Location> TryGetLocations(Address address, int maxItems, bool alternativeQuery = false)
Parameters
Type | Name | Description |
---|---|---|
Address | address | Lookup address. |
System.Int32 | maxItems | Maximum number of items to return. |
System.Boolean | alternativeQuery | Indicates whether the alternative/split query parameter format is used. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Location> | List of found items. |