module CartoDB # class to get the point number in GPX files class GPX def initialize(filename) @filename = filename @ogr2ogr_bin_path = `which ogr2ogr`.strip end def _points_for(table) cmd = "#{@ogr2ogr_bin_path} -f CSV /vsistdout/ #{@filename} -sql 'select count(*) from #{table}'" #RUBY WAY `#{cmd}`.strip.split[1].to_i end def track_points _points_for('track_points') end def route_points _points_for('route_points') end end end