demarches-normaliennes/app/lib/api_adresse/geocodeur.rb

12 lines
313 B
Ruby
Raw Normal View History

module ApiAdresse
2015-08-10 11:05:06 +02:00
# this class take a string in input and return a point
class Geocodeur
def self.convert_adresse_to_point(address)
2018-10-15 16:33:42 +02:00
ApiAdresse::PointRetriever.new(address).point
2015-08-10 11:05:06 +02:00
rescue RestClient::Exception, JSON::ParserError => e
2018-10-15 16:57:06 +02:00
Rails.logger.error(e.message)
2015-08-10 11:05:06 +02:00
nil
end
end
end