class ComtecDR::GpsTrack

Attributes

track[R]

Public Class Methods

analyze(file_path) click to toggle source
# File lib/comtec-dr/gps_track.rb, line 24
def analyze file_path
  self.new.tap do |track|
    ComtecDR::UdatAnalyzer.analyze(ComtecDR::MovDemuxer.demux file_path).each do |line|
      log = ComtecDR::GpsLog.new *[*line, Pathname.new(file_path).basename.to_s]
      track << log
    end
  end
end
new() click to toggle source
# File lib/comtec-dr/gps_track.rb, line 4
def initialize
  @track = []
end

Public Instance Methods

<<(log) click to toggle source
# File lib/comtec-dr/gps_track.rb, line 8
def << log
  @track << log
end
compress() click to toggle source

位置情報を圧縮

# File lib/comtec-dr/gps_track.rb, line 13
def compress
  new_track = self.class.new
  prev = []
  self.track.each do |t|
    new_track << t unless t.csv_line[0..2] == prev
    prev = t.csv_line[0..2]
  end
  new_track
end