Sha256: 188a19aeca25ddf58b82d5780f2ece6cce5139a3b26cf718ef6a67d7ba32d81c
Contents?: true
Size: 476 Bytes
Versions: 5
Compression:
Stored size: 476 Bytes
Contents
module GTFS class Realtime module Nearby def nearby(latitude, longitude) # TODO: this math is terrible! It'll fail for various edge cases. # (e.g. close to the poles, overlapping to the prime meridian) # That said, it's an okay approximation within the United States. all.select do |stop| (stop.latitude - latitude).abs < 0.01 && (stop.longitude - longitude).abs < 0.01 end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems