Table of Contents

Class Geocoder

Namespace
TimeCockpit.Data.Geolocation.OSM
Assembly
TimeCockpit.Data.dll

Geocoder utilizing openstreetmap services.

public class Geocoder
Inheritance
Object
Geocoder
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

nominatimBaseUri String

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.

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

address Address

Original/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

address Address

Lookup address.

location Location

Found location.

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

address Address

Lookup address.

maxItems Int32

Maximum number of items to return.

alternativeQuery Boolean

Indicates whether the alternative/split query parameter format is used.

Returns

List<Location>

List of found items.