Module: NoBrainer::Geo::Base

Extended by:
ActiveSupport::Concern
Included in:
Circle, LineString, Point, Polygon
Defined in:
lib/no_brainer/geo/base.rb

Class Method Summary collapse

Class Method Details

.normalize_geo_options(options) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/no_brainer/geo/base.rb', line 4

def self.normalize_geo_options(options)
  options = options.symbolize_keys

  geo_system  = options.delete(:geo_system) || NoBrainer::Config.geo_options[:geo_system]
  unit        = options.delete(:unit) || NoBrainer::Config.geo_options[:unit]

  options[:unit] = unit if unit && unit.to_s != 'm'
  options[:geo_system] = geo_system if geo_system && geo_system.to_s != 'WGS84'

  options
end