NAME

    sabx_csv - merge a CSV file into an SABX 1.0 file

SYNOPSIS

    sabx_csv [OPTION] csv_file

DESCRIPTION

    Merge the data from an SABX 1.0 file with the data from a CSV file.  The
    CSV data is merged with the points from a specified segment in the SABX 1.0
    file.  The resulting file will have a single ride based on the CSV file,
    and have the top-level data from the SABX 1.0 file. Generally, you merge
    the CSV file with an SABX 1.0 file that was generated by gpx2sabx or
    tcx2sabx that has only one segment in it. The CSV file format is described
    below.

    csv_file
        CSV file to merge with (or name of blank file)

    -i INFILE, --infile=INFILE
        SABX 1.0 file to read from

    -o OUTFILE, --outfile=OUTFILE
        SABX 1.0 file to read from

    -d ID, --id=ID
        id of segment to merge into (default 1)

    -b, --blank
        generate a blank CSV file ready to be filled-in (name it csv_file)

    -m, --man
        print this extended help and exit

    -h, --help
        print basic help and exit

CSV FILE FORMAT

    A CSV file has the information for a ride in a rideset. 

    The CSV file has the following columns:

    TYPE, START POINT, END POINT, TURN COMMENTS, TURN CUE, ROAD, ROAD COMMENTS, LANES, SHOULDER, SPEED, TRAFFIC

    The CSV file starts off with a row of labels, titled as above. After that,
    each row represents either a ride, parking, a road, a stop, or a poi. The
    TYPE column tells what type each row is.  Rows that have unrecognized TYPE
    column values are ignored.

    For TYPEs of PARK, STOP, and POI, the START POINT and END POINT columns can
    be interpreted either as a reference to a point in the SABX file, or as a
    (lat, lon) pair.  If it's a point, then START POINT contains a reference to
    the point's id.  If it's (lat,lon), then START POINT is the latitude and
    END POINT is the longitude.  Ids and lats are differentiated by the
    presence of a decimal point in the number.  This implies that proper ids
    don't have decimal points in them.

    For TYPE of ROAD, START POINT and END POINT are id's of the starting and
    ending points for the road.  Note that you should not end one road on an
    id, then start the next road on the same id.  SABX 1.0 files use the
    convention that a segment's ending point is really the start point of the
    following segment.

    For TYPE of RIDE, each column is treated thus:

        START POINT - ignored
        END POINT - ignored
        TURN COMMENTS - ignored
        TURN CUE - ignored
        ROAD - description of the ride
        ROAD COMMENTS - ignored
        LANES - ignored
        SHOULDER - ignored
        SPEED - ignored
        TRAFFIC - ignored

    For TYPE of PARK, each column is treated thus:

        START POINT - id or lat
        END POINT - ignored or lon
        TURN COMMENTS - ignored
        TURN CUE - ignored
        ROAD - description of the parking place
        ROAD COMMENTS - ignored
        LANES - ignored
        SHOULDER - ignored
        SPEED - ignored
        TRAFFIC - ignored

    For TYPE of ROAD, a turn and a segment is generated.  Each column is
    treated thus:
    
        START POINT - id 
        END POINT - id
        TURN COMMENTS - comments for turn
        TURN CUE - cue for turn
        ROAD - name of the road
        ROAD COMMENTS - comments for road
        LANES - number of lanes in road
        SHOULDER - shoulder description
        SPEED - speed limit
        TRAFFIC - traffic description

    For TYPE of STOP, each column is treated thus:

        START POINT - id or lat
        END POINT - ignored or lon
        TURN COMMENTS - ignored
        TURN CUE - type of stop
        ROAD - description of stop
        ROAD COMMENTS - ignored
        LANES - ignored
        SHOULDER - ignored
        SPEED - ignored
        TRAFFIC - ignored

    For TYPE of POI, each column is treated thus:

        START POINT - id or lat
        END POINT - ignored or lon
        TURN COMMENTS - ignored
        TURN CUE - ignored
        ROAD - description of POI
        ROAD COMMENTS - ignored
        LANES - ignored
        SHOULDER - ignored
        SPEED - ignored
        TRAFFIC - ignored

AUTHOR

    Jay Farrimond

REPORTING BUGS

    Report bugs to <jay@sabikerides.com>

SEE ALSO

    The complete specification for SABX 1.0 files is available at 
    http://www.sabikerides.com/sabx/1/0/

    The library that this utility is built on (sabx-lib) is available at
    http://www.sabikerides.com/sabx/lib/index.html

COPYRIGHT

    sabx10 - an SABX file manipulation library
    Copyright (C) 2009, 2010 Jay Farrimond (jay@sabikerides.com)

    This file is part of sabx10.

    sabx10 is free software: you can redistribute it and/or modify it under the
    terms of the GNU General Public License as published by the Free Software
    Foundation, either version 3 of the License, or (at your option) any later
    version.

    sabx10 is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    details.

    You should have received a copy of the GNU General Public License along
    with sabx10.  If not, see <http://www.gnu.org/licenses/>.