# File lib/geokit/mappable.rb, line 271
    def self.normalize(thing,other=nil)
      # if an 'other' thing is supplied, normalize the input by creating an array of two elements
      thing=[thing,other] if other
      
      if thing.is_a?(String)
        thing.strip!
        if match=thing.match(/(\-?\d+\.?\d*)[, ] ?(\-?\d+\.?\d*)$/)
          return Geokit::LatLng.new(match[1],match[2])
        else
          res = Geokit::Geocoders::MultiGeocoder.geocode(thing)
          return res if res.success?
          raise Geokit::Geocoders::GeocodeError  
        end
      elsif thing.is_a?(Array) && thing.size==2
        return Geokit::LatLng.new(thing[0],thing[1])
      elsif thing.is_a?(LatLng) # will also be true for GeoLocs
        return thing
      elsif thing.class.respond_to?(:acts_as_mappable) && thing.class.respond_to?(:distance_column_name)
        return thing.to_lat_lng
      end
      
      raise ArgumentError.new("#{thing} (#{thing.class}) cannot be normalized to a LatLng. We tried interpreting it as an array, string, Mappable, etc., but no dice.")
    end