Module: Vendor::Rgeo

Defined in:
lib/vendor/rgeo.rb

Class Method Summary collapse

Class Method Details

.coord_sys_is_wgs84?(cs) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
# File 'lib/vendor/rgeo.rb', line 3

def self.coord_sys_is_wgs84?(cs)
  # TODO: what else could a valid cs.name for WGS 84 be?
  wgs84_names = ['EPSG:4326', 'WGS 84', 'GCS_WGS_1984']

  cs.geographic? &&
    ((cs.name.present? && wgs84_names.include?(cs.name)) ||
    (cs.authority_code.present? && cs.authority_code == '4326'))
end