mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 01:31:39 -05:00
This adds support for Nominatim-based reverse geocoding, along with Photon and Geofi. To use it, set the environment variables: NOMINATIM_API_HOST - the host name of the OSM Nominatim server NOMINATIM_API_USE_HTTPS - use the HTTPS to connect NOMINATIM_API_KEY - the API key
25 lines
596 B
Ruby
25 lines
596 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DawarichSettings
|
|
class << self
|
|
def reverse_geocoding_enabled?
|
|
@reverse_geocoding_enabled ||= photon_enabled? || geoapify_enabled? || nominatim_enabled?
|
|
end
|
|
|
|
def photon_enabled?
|
|
@photon_enabled ||= PHOTON_API_HOST.present?
|
|
end
|
|
|
|
def photon_uses_komoot_io?
|
|
@photon_uses_komoot_io ||= PHOTON_API_HOST == 'photon.komoot.io'
|
|
end
|
|
|
|
def geoapify_enabled?
|
|
@geoapify_enabled ||= GEOAPIFY_API_KEY.present?
|
|
end
|
|
|
|
def nominatim_enabled?
|
|
@nominatim_enabled ||= NOMINATIM_API_HOST.present?
|
|
end
|
|
end
|
|
end
|