Sha256: e2a55ca1a03c9a4d01097fea2df74b72993110f73efb5fd8d487fa7bdcd317a5
Contents?: true
Size: 709 Bytes
Versions: 1
Compression:
Stored size: 709 Bytes
Contents
# frozen_string_literal: true # Finds points within a distance of a latitude/longitude point using bounding coordinates. # http://janmatuschek.de/LatitudeLongitudeBoundingCoordinates module JpmGeo class Error < StandardError; end EARTH_RADIUS_KM = 6371.01 EARTH_RADIUS_M = 3963.19 class << self attr_writer :radius def radius @radius || EARTH_RADIUS_KM end def units=(units) raise ArgumentError, "invalid units" unless units && %w[km m].include?(units.to_s) @units = units @radius = units == "km" ? EARTH_RADIUS_KM : EARTH_RADIUS_M end end end require "jpm_geo/version" require "jpm_geo/point" require "jpm_geo/bounds"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jpm_geo-0.1.1 | lib/jpm_geo.rb |