exe/gps2ubx in gps_pvt-0.8.5 vs exe/gps2ubx in gps_pvt-0.9.0

- old
+ new

@@ -7,18 +7,19 @@ # Convert file(s) to ubx format # TODO currently only RINEX observation file is supported. $stderr.puts <<__STRING__ Usage: #{__FILE__} GPS_file ... > as_you_like.ubx -As GPS_file, only rinex_obs(*.YYo) is currently supported. +As GPS_file, rinex_obs(*.YYo) and rtcm3 stream are supported. (YY = last two digit of year) File format is automatically determined based on its extention described in above parentheses. If you want to specify its format manually, command options like --rinex_obs=file_name are available. Supported RINEX versions are 2 and 3. RXM-RAWX and RXM-SFRBX are included in output UBX if corresponding file(s) is given. A file having additional ".gz" or ".Z" extension is recognized as a compressed file. -Major URL such as http(s)://... or ftp://... is acceptable as an input file name. +Major URL such as http(s)://... or ftp://... is acceptable as an input file name. +Ntrip specified in URI as ntrip://(username):(password)@(caster_host):(port)/(mount_point) is also supported, and its format is automatically detected. __STRING__ options = [] misc_options = { :broadcast_data => false, @@ -39,20 +40,20 @@ files.collect!{|fname, ftype| ftype ||= case fname when /\.\d{2}[nhqg](?:\.gz)?$/; :rinex_nav when /\.\d{2}o(?:\.gz)?$/; :rinex_obs when /\.ubx$/; :ubx - else - raise "Format cannot be guessed, use --(format, ex. rinex_obs)=#{fname}" end fname = proc{ next fname if File::exist?(fname) if uri = URI::parse(fname) and !uri.instance_of?(URI::Generic) then + ftype ||= uri.read_format if uri.instance_of?(URI::Ntrip) next uri end raise "File not found: #{fname}" }.call + raise "Format cannot be guessed, use --(format, ex. rinex_obs)=#{fname}" unless ftype [fname, ftype] } options.reject!{|opt| case opt[0] @@ -99,9 +100,10 @@ # other files files.each{|fname, ftype| case ftype when :ubx; rcv.parse_ubx(fname){} when :rinex_obs; rcv.parse_rinex_obs(fname){} + when :rtcm3; rcv.parse_rtcm3(fname){} end } obs.sort!{|a, b| a[0] <=> b[0]} # Sort by measurement time