forked from potsda.mn/mobilizon
feat(backend): add hat geocoder as a config
This commit is contained in:
parent
162d4f5fb1
commit
d5adda00a9
|
@ -149,51 +149,38 @@ geospatial_service =
|
||||||
"MapQuest" -> Mobilizon.Service.Geospatial.MapQuest
|
"MapQuest" -> Mobilizon.Service.Geospatial.MapQuest
|
||||||
"Mimirsbrunn" -> Mobilizon.Service.Geospatial.Mimirsbrunn
|
"Mimirsbrunn" -> Mobilizon.Service.Geospatial.Mimirsbrunn
|
||||||
"Pelias" -> Mobilizon.Service.Geospatial.Pelias
|
"Pelias" -> Mobilizon.Service.Geospatial.Pelias
|
||||||
|
"Hat" -> Mobilizon.Service.Geospatial.Hat
|
||||||
end
|
end
|
||||||
|
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial, service: geospatial_service
|
config :mobilizon, Mobilizon.Service.Geospatial, service: geospatial_service
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "Nominatim" do
|
config :mobilizon, Mobilizon.Service.Geospatial.Nominatim,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.Nominatim,
|
|
||||||
endpoint:
|
endpoint:
|
||||||
System.get_env(
|
System.get_env(
|
||||||
"MOBILIZON_GEOSPATIAL_NOMINATIM_ENDPOINT",
|
"MOBILIZON_GEOSPATIAL_NOMINATIM_ENDPOINT",
|
||||||
"https://nominatim.openstreetmap.org"
|
"https://nominatim.openstreetmap.org"
|
||||||
),
|
),
|
||||||
api_key: System.get_env("MOBILIZON_GEOSPATIAL_NOMINATIM_API_KEY", nil)
|
api_key: System.get_env("MOBILIZON_GEOSPATIAL_NOMINATIM_API_KEY", nil)
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "Addok" do
|
config :mobilizon, Mobilizon.Service.Geospatial.Addok,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.Addok,
|
|
||||||
endpoint:
|
endpoint:
|
||||||
System.get_env("MOBILIZON_GEOSPATIAL_ADDOK_ENDPOINT", "https://api-adresse.data.gouv.fr")
|
System.get_env("MOBILIZON_GEOSPATIAL_ADDOK_ENDPOINT", "https://api-adresse.data.gouv.fr")
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "Photon" do
|
config :mobilizon, Mobilizon.Service.Geospatial.Photon,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.Photon,
|
|
||||||
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_PHOTON_ENDPOINT", "https://photon.komoot.de")
|
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_PHOTON_ENDPOINT", "https://photon.komoot.de")
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "GoogleMaps" do
|
config :mobilizon, Mobilizon.Service.Geospatial.GoogleMaps,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.GoogleMaps,
|
|
||||||
api_key: System.get_env("MOBILIZON_GEOSPATIAL_GOOGLE_MAPS_API_KEY", nil),
|
api_key: System.get_env("MOBILIZON_GEOSPATIAL_GOOGLE_MAPS_API_KEY", nil),
|
||||||
fetch_place_details: true
|
fetch_place_details: true
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "MapQuest" do
|
config :mobilizon, Mobilizon.Service.Geospatial.MapQuest,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.MapQuest,
|
|
||||||
api_key: System.get_env("MOBILIZON_GEOSPATIAL_MAP_QUEST_API_KEY", nil)
|
api_key: System.get_env("MOBILIZON_GEOSPATIAL_MAP_QUEST_API_KEY", nil)
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "Mimirsbrunn" do
|
config :mobilizon, Mobilizon.Service.Geospatial.Mimirsbrunn,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.Mimirsbrunn,
|
|
||||||
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_MIMIRSBRUNN_ENDPOINT", nil)
|
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_MIMIRSBRUNN_ENDPOINT", nil)
|
||||||
end
|
|
||||||
|
|
||||||
if System.get_env("MOBILIZON_GEOSPATIAL_SERVICE", "Nominatim") == "Pelias" do
|
config :mobilizon, Mobilizon.Service.Geospatial.Pelias,
|
||||||
config :mobilizon, Mobilizon.Service.Geospatial.Pelias,
|
|
||||||
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_PELIAS_ENDPOINT", nil)
|
endpoint: System.get_env("MOBILIZON_GEOSPATIAL_PELIAS_ENDPOINT", nil)
|
||||||
end
|
|
||||||
|
|
||||||
sentry_dsn = System.get_env("MOBILIZON_ERROR_REPORTING_SENTRY_DSN", nil)
|
sentry_dsn = System.get_env("MOBILIZON_ERROR_REPORTING_SENTRY_DSN", nil)
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ defmodule Mobilizon.Service.Geospatial.Hat do
|
||||||
alias Mobilizon.Service.Geospatial.Addok
|
alias Mobilizon.Service.Geospatial.Addok
|
||||||
alias Mobilizon.Service.Geospatial.Nominatim
|
alias Mobilizon.Service.Geospatial.Nominatim
|
||||||
alias Mobilizon.Service.Geospatial.Provider
|
alias Mobilizon.Service.Geospatial.Provider
|
||||||
import Mobilizon.Service.Geospatial.Provider, only: [endpoint: 1]
|
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@behaviour Provider
|
@behaviour Provider
|
||||||
|
|
Loading…
Reference in a new issue