View Source Geospatial.Providers.Provider behaviour (Geospatial v0.3.4)
Provider Behaviour for Geospatial stuff.
Supported backends
Geospatial.Providers.Nominatim🔗Geospatial.Providers.Photon🔗Geospatial.Providers.Addok🔗Geospatial.Providers.MapQuest🔗Geospatial.Providers.GoogleMaps🔗Geospatial.Providers.Mimirsbrunn🔗Geospatial.Providers.Pelias🔗
Shared options
:langLang in which to prefer results. Used as a request parameter or through anAccept-LanguageHTTP header. Defaults to"en".:country_codeAn ISO 3166 country code. String ornil:limitMaximum limit for the number of results returned by the backend. Defaults to10:api_keyAllows to override the API key (if the backend requires one) set inside the configuration.:endpointAllows to override the endpoint set inside the configuration.
Summary
Callbacks
Get an address from longitude and latitude coordinates.
Lookup for an address by id
Search for an address
Callbacks
@callback geocode(longitude :: number(), latitude :: number(), options :: keyword()) :: [ Geospatial.Address.t() ]
Get an address from longitude and latitude coordinates.
Options
In addition to the shared options, geocode/3 also
accepts the following options:
zoomLevel of detail required for the address. Default: 15
Examples
iex> geocode(48.11, -1.77)
%Address{}
@callback get_by_id(id :: String.t(), options :: keyword()) :: [Geospatial.Address.t()]
Lookup for an address by id
@callback search(address :: String.t(), options :: keyword()) :: [Geospatial.Address.t()]
Search for an address
Options
In addition to the shared options, search/2 also
accepts the following options:
coordsMap of coordinates (ex:%{lon: 48.11, lat: -1.77}) allowing to give a geographic priority to the search. Defaults tonil.typeFilter by type of results. Allowed values::administrative(cities, regions)
Examples
iex> search("10 rue Jangot")
%Address{}
Functions
@spec coordinates([number() | String.t()]) :: Geo.Point.t() | nil
Returns a Geo.Point for given coordinates
@spec timezone(nil | Geo.Point.t()) :: nil | String.t()
Returns the timezone for a Geo.Point