module Geocoder::Calculations
def extract_coordinates(point)
running method and may return nil.
[lat,lon] array. Note that if a string is passed this may be a slow-
or an object that implements +to_coordinates+ and returns a
Takes an object which is a [lat,lon] array, a geocodable string,
#
def extract_coordinates(point) case point when Array if point.size == 2 and coordinates_present?(*point) return point.map {|coords| coords.to_f} end when String point = Geocoder.coordinates(point) and return point else if point.respond_to?(:to_coordinates) if Array === array = point.to_coordinates return extract_coordinates(array) end end end [ NAN, NAN ] end