Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Gerhard Olsson <gerhard.nospam@gm...> - 2007-06-30 17:01:20
|
Two kind of separate patches, but since I have developed and tested them together. Should not be too difficult to handle, as the only common file is xcsv.c (reading of options). No documentation updated (other than this mail), no enhancement bug submitted, I send them for review first. Tested in Cygwin/Linux. Possible impact on existing functionality: * Of course, there is a risk I have screwed up existing handling for reading/writing csv, but this is relative easy to review and test so the risk is low. * Parts of second is new functionality, mark as experimental * Realtime is marked as experimental still and not really working in CVS, so the risk should be low. ---------------------- CSV part of seconds support Robert added millisecond support to GPX in 1.3.3 However, there is no support in reading/writing parts of a second to CSV files. This is not an easy match as the time handling is defined to manipulating complete seconds. I have come up with the following handling, but someone may have better ideas? The following is done: Fields MILLISECOND and MICROSECOND added. Best written as ".%03" and ".%06" (using option "no_delim_before") "no_delim_before" implemented also for IFIELD with slightly differnt meaning, the complete info is parsed again. Example: IFIELD GMT_TIME,"","%m/%d/%Y %H:%M:%S" IFIELD MILLISECOND,"","%*m/%*d/%*Y %*H:%*M:%*S.%03d","no_delim_before" or IFIELD MILLISECOND,"","%*[^.].%03d","no_delim_before,optional" ISO_TIME_MS reads and writes time with milliseconds Possible caveeats: * No checks that the user have written time correctly for MILLISECOND and MICROSECOND. I.e 3.18 is interpreted as "18" us. The reason is that I know no way to find the length of a match, where sscanf starts and ends. A solution is to request that the user uses a %[0123456789] pattern and the resulting string is parsed, but that is clumsy. This is not a problem with *_MS field that has integrated * YYYMMDD_TIME_MS uses double when parsing that teoretically can give precision errors * Rounding is incorrect at output for MILLISECOND if (us > 999000)(unless for *_MS fields), there is no way to add seconds to a previously written fields (output set to 999) * No rounding for microseconds, always truncated Some code (commented out) for EXCEL_TIME_MS, but I cannot test it. Changes in csv_util.h, csv_util.c, xcsv.c ------------------- Realtime * support for CSV as output * support for "-" as output (sets the max_position_points to 1 (no big point for kml, but included)) * Files were not actually saved, until exit of utility (error in CVS, likely OK in 1.3.3) * input/output files had to be specified with -f, -F (not last on the command line) * kml files where max_position_points were set were garbled CSV support required some tweaks I wish I was not necessary: * Init (parse style etc) done only once. This increases the efficiency, but done mostly to avoid core when exit (wr_deinit called twice) * Must set datatype to wpt/trk to avoid double output of lines. Changes in xcsv.c, kml.c, main.c -- Gerhard The sender address really contains .nospam. |