| 1 |
<appendix xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="Styles"> |
| 2 |
<title>GPSBabel XCSV Style Files</title> |
| 3 |
<section xml:id="styles_intro"> |
| 4 |
<title>Introduction to GPSBabel Styles</title> |
| 5 |
<para>Often it is desirable to add a new file format for "one-off" work (perhaps |
| 6 |
you want to export something to a spreadsheet or graphing program) or to read |
| 7 |
a format that GPSBabel does not yet support. For suitably simple formats, |
| 8 |
this can be done by a user with no programming experience by providing a |
| 9 |
GPSBabel style file. |
| 10 |
</para> |
| 11 |
<para>For a format to be described by a style file, it must be predictable and |
| 12 |
generally readable by a human. Formats with binary or unreadable content |
| 13 |
are not good fits for this scheme. It should have: |
| 14 |
<simplelist> |
| 15 |
<member>A fixed header at the beginning, if it has any at all. This is called a 'prologue'.</member> |
| 16 |
<member>Waypoints that are grouped by fixed separators, often a newline. In style file parlance, this is called a 'record'.</member> |
| 17 |
<member>Traits of that waypoint described in that record. In the style files, these are called 'fields' and examples may include longitude or a name.</member> |
| 18 |
<member>Fields that are grouped by fixed separators, often a comma or a tab. In the style files, this is called the field separator. Fields may be enclosed by characters, such as a double quote.</member> |
| 19 |
<member>A fixed footer at the end, if it has any at all. This is called the 'epilogue'.</member></simplelist> |
| 20 |
</para> |
| 21 |
<para>Once you have created a style file that describes the file format you have |
| 22 |
or want, you must tell GPSBabel to use the xcsv format and have the xcsv |
| 23 |
format use that file. If you created a new style file called |
| 24 |
"mystyle.style" and you want to write the waypoints from |
| 25 |
a GPX file named "mine.gpx" to it, you would issue a command like: |
| 26 |
</para> |
| 27 |
<para> |
| 28 |
<userinput>gpsbabel -i gpx -f mine.gpx -o xcsv,style=mystyle.style -F mine.new</userinput> |
| 29 |
</para> |
| 30 |
<para>You might then examine |
| 31 |
<filename>mine.new</filename> |
| 32 |
to see if it met |
| 33 |
your expectations. If not, you could continue to tweak |
| 34 |
|
| 35 |
<filename>mystyle.style</filename> |
| 36 |
until it did, rerunning the above |
| 37 |
command each time. If 'mystyle' is a format |
| 38 |
that describes a popular program or is likely to be of use to others, you can |
| 39 |
then share |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
<filename>mystyle.style</filename> |
| 47 |
with other GPSBabel users. |
| 48 |
Send it along with a coherent description to the GPSBabel-Misc mailing |
| 49 |
list for consideration to be included in a future version.</para> |
| 50 |
</section> |
| 51 |
<section xml:id="style_intro2"> |
| 52 |
<title>Style file overview</title> |
| 53 |
<para>The first and foremost important step is understanding how the style |
| 54 |
file is laid out itself. The format is: |
| 55 |
</para> |
| 56 |
<screen>DIRECTIVE<whitespace>VALUE</screen> |
| 57 |
<para>Where <whitespace> is one or more spaces or tabs. There should |
| 58 |
be no spaces or tabs at the beginning of the line; all directives start |
| 59 |
at the left edge in column zero. |
| 60 |
</para> |
| 61 |
<para>An example style format is shown here: |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
<literallayout># Format: MS S&T 2002/2003 |
| 70 |
# Author: Alex Mottram |
| 71 |
# Date: 12/09/2002 |
| 72 |
# |
| 73 |
|
| 74 |
DESCRIPTION Microsoft Streets and Trips 2002-2006 |
| 75 |
EXTENSION txt |
| 76 |
|
| 77 |
# |
| 78 |
# FILE LAYOUT DEFINITIIONS: |
| 79 |
# |
| 80 |
FIELD_DELIMITER TAB |
| 81 |
RECORD_DELIMITER NEWLINE |
| 82 |
BADCHARS ," |
| 83 |
|
| 84 |
PROLOGUE Name Latitude Longitude Description URL Type Container Diff Terr |
| 85 |
|
| 86 |
# |
| 87 |
# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: |
| 88 |
# NOTE: MS S&T ONLY IMPORTS DATA, IT DOESN'T |
| 89 |
# EXPORT THIS ANYWHERE SO WE CAN HAVE OUR |
| 90 |
# WAY WITH THE FORMATTING. |
| 91 |
# |
| 92 |
IFIELD SHORTNAME, "", "%s" # Name |
| 93 |
IFIELD LAT_DECIMAL, "", "%f" # Latitude |
| 94 |
IFIELD LON_DECIMAL, "", "%f" # Longitude |
| 95 |
IFIELD DESCRIPTION, "", "%s" # Name 2 (Big Description) |
| 96 |
IFIELD URL, "", "%s" # URL |
| 97 |
IFIELD GEOCACHE_TYPE, "", "%s" # Geocache Type |
| 98 |
IFIELD GEOCACHE_CONTAINER, "", "%s" # Geocache Type |
| 99 |
IFIELD GEOCACHE_DIFF, "", "%3.1f" # Geocache Type |
| 100 |
IFIELD GEOCACHE_TERR, "", "%3.1f" # Geocache Type |
| 101 |
</literallayout> |
| 102 |
Each of these lines will be explained in the following sections.</para> |
| 103 |
</section> |
| 104 |
<!-- intro --> |
| 105 |
<section xml:id="styles_internal_const"> |
| 106 |
<title>Internal Constants</title> |
| 107 |
<para>A few internal constants are defined in the XCSV parser to make the style |
| 108 |
file simpler. They may or may not be used and are optional in most cases. |
| 109 |
Note that only certain style file directives map these constants. |
| 110 |
</para> |
| 111 |
<para> |
| 112 |
<segmentedlist> |
| 113 |
<?dbhtml list-presentation="table"?> |
| 114 |
<segtitle>Style Constant</segtitle> |
| 115 |
<segtitle>Maps to Char(s)</segtitle> |
| 116 |
<seglistitem> |
| 117 |
<seg>COMMA</seg> |
| 118 |
<seg>,</seg> |
| 119 |
</seglistitem> |
| 120 |
<seglistitem> |
| 121 |
<seg>COMMASPACE</seg> |
| 122 |
<seg>,<space></seg> |
| 123 |
</seglistitem> |
| 124 |
<seglistitem> |
| 125 |
<seg>SINGLEQUOTE</seg> |
| 126 |
<seg>'</seg> |
| 127 |
</seglistitem> |
| 128 |
<seglistitem> |
| 129 |
<seg>DOUBLEQUOTE</seg> |
| 130 |
<seg>"</seg> |
| 131 |
</seglistitem> |
| 132 |
<seglistitem> |
| 133 |
<seg>COLON</seg> |
| 134 |
<seg>:</seg> |
| 135 |
</seglistitem> |
| 136 |
<seglistitem> |
| 137 |
<seg>SEMICOLON</seg> |
| 138 |
<seg>;</seg> |
| 139 |
</seglistitem> |
| 140 |
<seglistitem> |
| 141 |
<seg>NEWLINE</seg> |
| 142 |
<seg>\n</seg> |
| 143 |
</seglistitem> |
| 144 |
<seglistitem> |
| 145 |
<seg>CR</seg> |
| 146 |
<seg>\r</seg> |
| 147 |
</seglistitem> |
| 148 |
<seglistitem> |
| 149 |
<seg>CRNEWLINE</seg> |
| 150 |
<seg>\r\n</seg> |
| 151 |
</seglistitem> |
| 152 |
<seglistitem> |
| 153 |
<seg>TAB</seg> |
| 154 |
<seg>\t</seg> |
| 155 |
</seglistitem> |
| 156 |
<seglistitem> |
| 157 |
<seg>SPACE</seg> |
| 158 |
<seg><space></seg> |
| 159 |
</seglistitem> |
| 160 |
<seglistitem> |
| 161 |
<seg>HASH</seg> |
| 162 |
<seg>#</seg> |
| 163 |
</seglistitem> |
| 164 |
<seglistitem> |
| 165 |
<seg>PIPE</seg> |
| 166 |
<seg>|</seg> |
| 167 |
</seglistitem> |
| 168 |
<seglistitem> |
| 169 |
<seg>WHITESPACE</seg> |
| 170 |
<seg>see below</seg> |
| 171 |
</seglistitem> |
| 172 |
</segmentedlist> |
| 173 |
</para> |
| 174 |
<section xml:id="style_const_whitespace"> |
| 175 |
<title>WHITESPACE</title> |
| 176 |
<para>The WHITESPACE constant has special properties. When reading data, |
| 177 |
WHITESPACE refers to sequential runs of SPACES and/or TABS. When |
| 178 |
writing data, WHITESPACE is always a single SPACE. |
| 179 |
</para> |
| 180 |
<para>For example, the following line: |
| 181 |
</para> |
| 182 |
<screen>SOME_NAME 30.1208 -91.1365 SOME OTHER NAME |
| 183 |
</screen> |
| 184 |
<para>Parses into the following data fields: |
| 185 |
</para> |
| 186 |
<screen>SOME_NAME,30.1208,-91.1365,SOME,OTHER,NAME |
| 187 |
</screen> |
| 188 |
</section> |
| 189 |
<section xml:id="style_const_comments"> |
| 190 |
<title>COMMENTS</title> |
| 191 |
<para>Anything after a hash (#) on a line is not parsed. For example: |
| 192 |
</para> |
| 193 |
<screen>#THIS ENTIRE LINE IS A COMMENT. |
| 194 |
#FIELD LAT_DECIMAL, "", "%f" THIS ENTIRE LINE IS A COMMENT |
| 195 |
FIELD LAT_DECIMAL, "", "%f" # ONLY THIS SENTENCE IS A COMMENT. |
| 196 |
</screen> |
| 197 |
</section> |
| 198 |
</section> |
| 199 |
<!-- internal constants --> |
| 200 |
<section xml:id="style_global"> |
| 201 |
<title>Global Properties of the File</title> |
| 202 |
<para>There are a few available directives to describe general traits of the |
| 203 |
file being described and not specific data within the file itself. |
| 204 |
</para> |
| 205 |
<section xml:id="style_global_description"> |
| 206 |
<title>DESCRIPTION</title> |
| 207 |
<para>This is the description of the file format being described. This text |
| 208 |
appears in the help screens and in menus used by the various GUI wrappers. |
| 209 |
</para> |
| 210 |
</section> |
| 211 |
<section xml:id="style_global_extension"> |
| 212 |
<title>EXTENSION</title> |
| 213 |
<para>This directive gives the filename extension generally associated with |
| 214 |
this file. |
| 215 |
</para> |
| 216 |
</section> |
| 217 |
<section xml:id="style_global_encoding"> |
| 218 |
<title>ENCODING</title> |
| 219 |
<para>Describes the character set used by this format. The value given |
| 220 |
must be one listed by 'gpsbabel -l'. example: |
| 221 |
</para> |
| 222 |
<screen>ENCODING UTF-8 # Use UTF-8 for input and output. |
| 223 |
</screen> |
| 224 |
</section> |
| 225 |
<section xml:id="style_global_datum"> |
| 226 |
<title>DATUM</title> |
| 227 |
<para>This value specifies the GPS datum to be used on read or write. Valid values for this |
| 228 |
option are listed in |
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
<xref linkend="Datums"/> |
| 236 |
.</para> |
| 237 |
<screen>DATUM European 1950 |
| 238 |
</screen> |
| 239 |
</section> |
| 240 |
<section xml:id="style_global_datatype"> |
| 241 |
<title>DATATYPE</title> |
| 242 |
<para>Specifies the kind of data we have to read or write. |
| 243 |
</para> |
| 244 |
<para>By default all data are seen as waypoint data. With DATATYPE you are now able to bind |
| 245 |
a specific type to this format. Possible values are WAYPOINT, ROUTE or TRACK. |
| 246 |
</para> |
| 247 |
<screen>DATATYPE ROUTE # route-only format |
| 248 |
</screen> |
| 249 |
</section> |
| 250 |
</section> |
| 251 |
<!-- global --> |
| 252 |
<section xml:id="style_behavior"> |
| 253 |
<title>GPSBabel Behavior Directives</title> |
| 254 |
<para>There are a few available directives to control some of the internal |
| 255 |
processing functions of GPSBabel. |
| 256 |
</para> |
| 257 |
<section xml:id="style_behave_shortlen"> |
| 258 |
<title>SHORTLEN</title> |
| 259 |
<para>This sets the maximum allowed shortname length when using the internal |
| 260 |
shortname synthesizer. |
| 261 |
</para> |
| 262 |
<para>example: |
| 263 |
</para> |
| 264 |
<screen>SHORTLEN 16 # shortnames will be at most 16 characters long. |
| 265 |
</screen> |
| 266 |
</section> |
| 267 |
<section xml:id="style_behave_shortwhite"> |
| 268 |
<title>SHORTWHITE</title> |
| 269 |
<para>This tells the shortname synthesizer whether or not to allow whitespace |
| 270 |
in the synthesized shortnames. Allowed values are zero and one. |
| 271 |
</para> |
| 272 |
<para>example: |
| 273 |
</para> |
| 274 |
<screen>SHORTWHITE 0 # Do not allow whitespace in shortname. |
| 275 |
SHORTWHITE 1 # Allow whitespace in shortname. |
| 276 |
</screen> |
| 277 |
</section> |
| 278 |
</section> |
| 279 |
<!-- behavior --> |
| 280 |
<section xml:id="style_layout"> |
| 281 |
<title>Defining the Layout of the File</title> |
| 282 |
<para>The first few directives define the layout the physical file itself: |
| 283 |
</para> |
| 284 |
<section xml:id="style_layout_field"> |
| 285 |
<title>FIELD_DELIMITER</title> |
| 286 |
<para>The field delimiter defines the character(s) that separate the fields in |
| 287 |
the rows of data inside the XCSV file. Common field delimiters are commas |
| 288 |
and tabs. (referred to as "comma separated values" and "tab separated |
| 289 |
values") |
| 290 |
</para> |
| 291 |
<para>examples: |
| 292 |
</para> |
| 293 |
<screen>FIELD_DELIMITER COMMA |
| 294 |
FIELD_DELIMITER ~ |
| 295 |
</screen> |
| 296 |
<para>The directive FIELD_DELIMITER is parsed for STYLE CONSTANTS as defined in |
| 297 |
the table above. |
| 298 |
</para> |
| 299 |
</section> |
| 300 |
<section xml:id="style_layout_field_enclose"> |
| 301 |
<title>FIELD_ENCLOSER</title> |
| 302 |
<para>The field encloser defines the character(s) that surround the field values. |
| 303 |
Common field enclosers are single and double quote marks. Many styles will |
| 304 |
leave this directive unset. If set, it will be applied to all fields. |
| 305 |
</para> |
| 306 |
<para>examples: |
| 307 |
</para> |
| 308 |
<screen>FIELD_ENCLOSER DOUBLEQUOTE |
| 309 |
FIELD_ENCLOSER SINGLEQUOTE |
| 310 |
</screen> |
| 311 |
<para>The directive FIELD_ENCLOSER is parsed for STYLE CONSTANTS as defined in |
| 312 |
the table above. |
| 313 |
</para> |
| 314 |
</section> |
| 315 |
<section xml:id="style_layout_rec"> |
| 316 |
<title>RECORD_DELIMITER</title> |
| 317 |
<para>The record delimiter defines that character(s) that separate ROWS of |
| 318 |
data (FIELDS) in the XCSV file. The most common record delimiters |
| 319 |
are NEWLINE and CR (carriage return). |
| 320 |
</para> |
| 321 |
<para>examples: |
| 322 |
</para> |
| 323 |
<screen>RECORD_DELIMITER NEWLINE |
| 324 |
RECORD_DELIMITER | |
| 325 |
</screen> |
| 326 |
<para>The directive RECORD_DELIMITER is parsed for STYLE CONSTANTS as defined |
| 327 |
in the table above. |
| 328 |
</para> |
| 329 |
</section> |
| 330 |
<section xml:id="style_layout_badchars"> |
| 331 |
<title>BADCHARS</title> |
| 332 |
<para>Bad characters are things that should *never* be written into the XCSV |
| 333 |
file as data on output. GPSBabel automatically includes any non-blank |
| 334 |
FIELD_DELIMITER and FIELD_ENCLOSER and RECORD_DELIMITER characters as |
| 335 |
BADCHARS by default. |
| 336 |
</para> |
| 337 |
<para>examples: |
| 338 |
</para> |
| 339 |
<screen>BADCHARS COMMA |
| 340 |
BADCHARS ~| |
| 341 |
</screen> |
| 342 |
<para>The directive BADCHARS is parsed for STYLE CONSTANTS as defined in the |
| 343 |
table above. |
| 344 |
</para> |
| 345 |
</section> |
| 346 |
<section xml:id="style_layout_prologue"> |
| 347 |
<title>PROLOGUE</title> |
| 348 |
<para>A prologue is basically constant data that is written to the output |
| 349 |
file BEFORE any waypoints are processed. PROLOGUE can be defined |
| 350 |
multiple times in the style file, once for each "line" before the data |
| 351 |
begins. This is commonly used in XCSV files as a "header" row. |
| 352 |
</para> |
| 353 |
<para>examples: |
| 354 |
</para> |
| 355 |
<screen>PROLOGUE OziExplorer Waypoint File Version 1.1 |
| 356 |
PROLOGUE WGS 84 |
| 357 |
PROLOGUE Symbol,Name,Latitude,Longitude |
| 358 |
</screen> |
| 359 |
</section> |
| 360 |
<section xml:id="style_layout_epilogue"> |
| 361 |
<title>EPILOGUE</title> |
| 362 |
<para>An Epilogue is the same as a prologue, except this data is written at |
| 363 |
the END of the file. See the examples for PROLOGUE above. |
| 364 |
</para> |
| 365 |
</section> |
| 366 |
</section> |
| 367 |
<!-- layout --> |
| 368 |
<section xml:id="style_define"> |
| 369 |
<title>Defining Fields Within the File</title> |
| 370 |
<para>A field defines data. There are two different classifications of FIELDS, |
| 371 |
IFIELD (file input) and OFIELD (file output). In the absence of any OFIELDS, |
| 372 |
IFIELDS are use as both input and output. The existence of OFIELDS is |
| 373 |
primarily to allow more flexible mapping of GPSBabel data to output data |
| 374 |
(say, for instance, to map the internal GPSBabel "description" variable to |
| 375 |
two or more fields on output). For all practical purposes, IFIELDS and |
| 376 |
OFIELDS are defined the same way in the style file.</para> |
| 377 |
<para>The following per-field options are defined: |
| 378 |
</para> |
| 379 |
<itemizedlist> |
| 380 |
<listitem> |
| 381 |
<para>"no_delim_before" is supported on in OFIELD tags to specify that this |
| 382 |
field should be written without a field delimiter before it. It's |
| 383 |
useful for limited field concatenation. |
| 384 |
</para> |
| 385 |
</listitem> |
| 386 |
<listitem> |
| 387 |
<para>"absolute" is supported on OFIELD tags for lat and lon to indicate |
| 388 |
that only absolute values (never negative) are to be printed. |
| 389 |
</para> |
| 390 |
</listitem> |
| 391 |
<listitem> |
| 392 |
<para>"optional" is supported only OFIELD tags and indicates that the |
| 393 |
field may or may not be available in the source data. If the |
| 394 |
field is absent, no trailing field separator is written. |
| 395 |
</para> |
| 396 |
<para>This attribute is most useful when paired with "no_delim_before" as |
| 397 |
it allows you to concatenate fields without concern for whether those |
| 398 |
fields are actually populated or not. |
| 399 |
</para> |
| 400 |
</listitem> |
| 401 |
</itemizedlist> |
| 402 |
<para>There are several different types of fields that may be defined. Each field |
| 403 |
consists of three pieces of information: the FIELD TYPE, a DEFAULT VALUE, and |
| 404 |
a PRINTF CONVERSION (for output). In many cases, not all pieces are used, |
| 405 |
but all 3 pieces are required. Additionally, an fourth field is supported |
| 406 |
that modifies the behavior of the field being described. |
| 407 |
</para> |
| 408 |
<para>FIELDS should be defined in the style file in the logical order that they |
| 409 |
appear in the data, from left to right. This is the order in which they are |
| 410 |
parsed from input and written to output. |
| 411 |
</para> |
| 412 |
<para>The fields used by the XCSV parser are as follows: |
| 413 |
</para> |
| 414 |
<section xml:id="style_def_ignore"> |
| 415 |
<title>IGNORE</title> |
| 416 |
<para>IGNORE fields are, guess what, ignored on input. Internally, IGNORE |
| 417 |
fields are treated as CHARACTER data, and as such, require a printf |
| 418 |
conversion for a character array. |
| 419 |
</para> |
| 420 |
<para>examples: |
| 421 |
</para> |
| 422 |
<screen>IFIELD IGNORE,"","%14.14s" # (writes a 14 character blank field) |
| 423 |
IFIELD IGNORE,"","%s" # (writes a blank field on output) |
| 424 |
</screen> |
| 425 |
</section> |
| 426 |
<section xml:id="style_def_constant"> |
| 427 |
<title>CONSTANT</title> |
| 428 |
<para>CONSTANT fields are, of course, constant. They are ignored on input, |
| 429 |
however they write CONSTANT data on output. As such, they require a |
| 430 |
DEFAULT VALUE and a printf conversion for a character array. |
| 431 |
</para> |
| 432 |
<para>examples: |
| 433 |
</para> |
| 434 |
<screen>IFIELD CONSTANT,"FFFFFF","%s" # (writes "FFFFFF" in the field) |
| 435 |
IFIELD CONSTANT,"01/01/70","%s" # (a constant date field) |
| 436 |
</screen> |
| 437 |
</section> |
| 438 |
<section xml:id="style_def_index"> |
| 439 |
<title>INDEX</title> |
| 440 |
<para>An INDEX field is used ONLY on output. The INDEX constant defines a field |
| 441 |
that, at output, contains the sequence number of the waypoint being |
| 442 |
written, starting at 0. An index is managed internally as an INTEGER |
| 443 |
and requires an INTEGER printf conversion. An INDEX has one special |
| 444 |
property. The DEFAULT VALUE of the index is added to the index |
| 445 |
on each iteration (to allow indexes starting at 1, 100, etc..). |
| 446 |
</para> |
| 447 |
<para>examples: |
| 448 |
</para> |
| 449 |
<screen>IFIELD INDEX,"0","%04d" # (Starts counting at zero) |
| 450 |
IFIELD INDEX,"","%04d" # (Starts counting at zero) |
| 451 |
IFIELD INDEX,"1","%04d" # (Starts counting at one) |
| 452 |
</screen> |
| 453 |
</section> |
| 454 |
<section xml:id="style_def_shortname"> |
| 455 |
<title>SHORTNAME</title> |
| 456 |
<para>A SHORTNAME is generally the waypoint name of the data being processed. |
| 457 |
SHORTNAME maps directly to the GPSBabel variable ->shortname. A SHORTNAME |
| 458 |
is CHARACTER data and requires a character array printf conversion. |
| 459 |
</para> |
| 460 |
<para>example: |
| 461 |
</para> |
| 462 |
<screen>IFIELD SHORTNAME,"","%s" |
| 463 |
</screen> |
| 464 |
</section> |
| 465 |
<section xml:id="style_def_description"> |
| 466 |
<title>DESCRIPTION</title> |
| 467 |
<para>A DESCRIPTION is generally a long description of the waypoint. A |
| 468 |
DESCRIPTION maps to the GPSBabel variable ->description and is otherwise |
| 469 |
handled exactly like a SHORTNAME. |
| 470 |
</para> |
| 471 |
<para>examples: |
| 472 |
</para> |
| 473 |
<screen>IFIELD DESCRIPTION,"","%s" |
| 474 |
</screen> |
| 475 |
</section> |
| 476 |
<section xml:id="style_def_notes"> |
| 477 |
<title>NOTES</title> |
| 478 |
<para>NOTES are generally everything else about a waypoints. NOTES map to the |
| 479 |
GPSBabel variable ->notes and is otherwise handled exactly like a |
| 480 |
SHORTNAME. |
| 481 |
</para> |
| 482 |
</section> |
| 483 |
<section xml:id="style_def_url"> |
| 484 |
<title>URL</title> |
| 485 |
<para>URL is a URL for the waypoint. URL maps to the GPSBabel variable |
| 486 |
->url and is otherwise handled exactly like a SHORTNAME. |
| 487 |
</para> |
| 488 |
<para>example: |
| 489 |
</para> |
| 490 |
<screen>IFIELD URL,"","%s" |
| 491 |
</screen> |
| 492 |
</section> |
| 493 |
<section xml:id="style_def_urllinktext"> |
| 494 |
<title>URL_LINK_TEXT</title> |
| 495 |
<para>URL_LINK_TEXT is a textual description of where a URL points. |
| 496 |
URL_LINK_TEXT maps to the GPSBabel variable ->url_link_text and |
| 497 |
is otherwise handled exactly like a SHORTNAME. |
| 498 |
</para> |
| 499 |
<para>example: |
| 500 |
</para> |
| 501 |
<screen>IFIELD URL_LINK_TEXT,"","%s" |
| 502 |
</screen> |
| 503 |
</section> |
| 504 |
<section xml:id="style_def_icondescr"> |
| 505 |
<title>ICON_DESCR</title> |
| 506 |
<para>ICON_DESCR is a textual description of an icon type for a waypoint. |
| 507 |
ICON_DESCR maps to the GPSBabel variable ->icon_desc and is otherwise |
| 508 |
handled exactly like a SHORTNAME. |
| 509 |
</para> |
| 510 |
<para>example: |
| 511 |
</para> |
| 512 |
<screen>IFIELD ICON_DESCR,"","%s" |
| 513 |
</screen> |
| 514 |
</section> |
| 515 |
<section xml:id="style_def_latdec"> |
| 516 |
<title>LAT_DECIMAL</title> |
| 517 |
<para>LAT_DECIMAL defines LATITUDE in DECIMAL format. Note that this is a PURE |
| 518 |
signed decimal format (i.e. -91.0000). This data is handled internally as |
| 519 |
a DOUBLE PRECISION FLOAT and requires a FLOATING POINT printf conversion. |
| 520 |
</para> |
| 521 |
<para>example: |
| 522 |
</para> |
| 523 |
<screen>IFIELD LAT_DECIMAL,"","%f" |
| 524 |
</screen> |
| 525 |
</section> |
| 526 |
<section xml:id="style_def_londec"> |
| 527 |
<title>LON_DECIMAL</title> |
| 528 |
<para>See LAT_DECIMAL, except LON_DECIMAL defines LONGITUDE. |
| 529 |
</para> |
| 530 |
</section> |
| 531 |
<section xml:id="style_def_latint32"> |
| 532 |
<title>LAT_INT32DEG</title> |
| 533 |
<para>LAT_INT32DEG defines LATITUDE in what I call INT32DEGREES. This value is |
| 534 |
a signed LONG INTEGER and requires a LONG INTEGER printf conversion. |
| 535 |
(This format is only used by some DeLorme products.) |
| 536 |
</para> |
| 537 |
<para>example: |
| 538 |
</para> |
| 539 |
<screen>IFIELD LAT_INT32DEG,"","%ld" |
| 540 |
</screen> |
| 541 |
</section> |
| 542 |
<section xml:id="style_def_lonint32"> |
| 543 |
<title>LON_INT32DEG</title> |
| 544 |
<para>See LON_INT32DEG except LON_INT32DEG defines LONGITUDE. |
| 545 |
</para> |
| 546 |
</section> |
| 547 |
<section xml:id="style_def_latdirdec"> |
| 548 |
<title>LAT_DECIMALDIR / LAT_DIRDECIMAL</title> |
| 549 |
<para>LAT_DECIMALDIR and LAT_DIRDECIMAL define LATITUDE in DECIMAL format |
| 550 |
with the added bonus of a 'N/S' or 'E/W' direction character. This data |
| 551 |
is handled internally as a DOUBLE PRECISION FLOAT and a single |
| 552 |
CHARACTER and requires a FLOATING POINT as well as a CHARACTER printf |
| 553 |
conversion. The only difference between the two is whether the directional |
| 554 |
character appears before (LAT_DIRDECIMAL) or after (LAT_DECIMALDIR) the |
| 555 |
decimal number. |
| 556 |
</para> |
| 557 |
<para>examples: |
| 558 |
</para> |
| 559 |
<screen>IFIELD LAT_DECIMALDIR,"","%f %c" # (writes 31.333 N) |
| 560 |
IFIELD LAT_DIRDECIMAL,"","%c %f" # (writes N 31.333) |
| 561 |
</screen> |
| 562 |
</section> |
| 563 |
<section xml:id="style_def_londirdec"> |
| 564 |
<title>LON_DECIMALDIR / LON_DIRDECIMAL</title> |
| 565 |
<para>Same as LAT_DECIMALDIR / LAT_DIRDECIMAL except LON_ defines LONGITUDE. |
| 566 |
</para> |
| 567 |
</section> |
| 568 |
<section xml:id="style_def_latlondir"> |
| 569 |
<title>LAT_DIR / LON_DIR</title> |
| 570 |
<para>LAT_DIR returns the single character 'N' or 'S' depending on the |
| 571 |
hemisphere of the latitude. LON_DIR returns 'E' or 'W' depending on |
| 572 |
the hemisphere of the longitude. |
| 573 |
</para> |
| 574 |
</section> |
| 575 |
<section xml:id="style_def_lathuman"> |
| 576 |
<title>LAT_HUMAN_READABLE</title> |
| 577 |
<para>LAT_HUMAN_READABLE defines LATITUDE in a human-readable format. This |
| 578 |
format is probably the most expressive format. It is similar to |
| 579 |
LAT_DECIMALDIR in that it requires multiple printf conversions, but it |
| 580 |
is far more flexible as to the contents of those conversions. On read, |
| 581 |
the printf conversions are ignored and GPSBabel attempts to determine the |
| 582 |
latitude and longitude based on what is in the file. |
| 583 |
</para> |
| 584 |
<para>examples: |
| 585 |
</para> |
| 586 |
<screen># (writes N 31 40.000) |
| 587 |
IFIELD LAT_HUMAN_READABLE,"","%c %d %f" |
| 588 |
# (writes "31 deg 40.000 min N") |
| 589 |
IFIELD LAT_HUMAN_READABLE,"","%d deg %f min %c" |
| 590 |
# Note that this string will confuse the reading routine due |
| 591 |
# to the letter "n" in "min" and the letter "e" in "deg." |
| 592 |
# (writes 31 40 00.000N) |
| 593 |
IFIELD LAT_HUMAN_READABLE,"","%d %d %f%c" |
| 594 |
</screen> |
| 595 |
</section> |
| 596 |
<section xml:id="style_def_map_en_bng"> |
| 597 |
<title>MAP_EN_BNG</title> |
| 598 |
<para>MAP_EN_BNG converts coordinates from/to British National Grid (BNG). |
| 599 |
</para> |
| 600 |
<para>The only supported order of the items is: Map,Easting,Northing. |
| 601 |
During output all coordinates have to be located within this limited area. |
| 602 |
</para> |
| 603 |
<para>examples: |
| 604 |
</para> |
| 605 |
<screen>IFIELD MAP_EN_BNG,"","%s%5d %5d" # (writes i.e. "SJ00001 00001") |
| 606 |
IFIELD MAP_EN_BNG,"","%s %d %d" # (writes i.e. "TQ 888 999") |
| 607 |
</screen> |
| 608 |
</section> |
| 609 |
<section xml:id="style_def_lonhuman"> |
| 610 |
<title>LON_HUMAN_READABLE</title> |
| 611 |
<para>See LAT_HUMAN_READABLE except LON_HUMAN_READABLE defines LONGITUDE. |
| 612 |
</para> |
| 613 |
</section> |
| 614 |
<section xml:id="style_def_latlonhuman"> |
| 615 |
<title>LATLON_HUMAN_READABLE</title> |
| 616 |
<para>LATLON_HUMAN_READABLE is like LAT_HUMAN_READABLE and LON_HUMAN_READABLE |
| 617 |
except that it reads and writes both latitude and longitude as a single |
| 618 |
field. On write, the same format specifier is used for both coordinates. |
| 619 |
On read, GPSBabel does exactly the same thing it does for |
| 620 |
LAT_HUMAN_READABLE or LON_HUMAN_READABLE. |
| 621 |
</para> |
| 622 |
<para>example: |
| 623 |
</para> |
| 624 |
<screen>IFIELD LATLON_HUMAN_READABLE,"","%c %d %f" |
| 625 |
# (writes "N 31 40.126 W 85 09.62" as a single field) |
| 626 |
</screen> |
| 627 |
</section> |
| 628 |
<section xml:id="style_def_latnmea"> |
| 629 |
<title>LAT_NMEA</title> |
| 630 |
<para>Defines the latitude in the format used by the NMEA standard which is |
| 631 |
degrees multiplied by 100 plus decimal minutes. |
| 632 |
</para> |
| 633 |
<para>example: |
| 634 |
</para> |
| 635 |
<screen>IFIELD LAT_NMEA, "%f", "%08.3f" # (writes 3558.322) |
| 636 |
</screen> |
| 637 |
</section> |
| 638 |
<section xml:id="style_def_latddmmdir"> |
| 639 |
<title>LAT_DDMMDIR</title> |
| 640 |
<para>Derived from the LAT_NMEA latitude format, with degrees * 100 plus decimal |
| 641 |
minutes, but using an additional specifier to position the 'N' or 'S' instead of a leading minus sign (or |
| 642 |
absence thereof) to give direction from zero. |
| 643 |
</para> |
| 644 |
<para> |
| 645 |
<screen>IFIELD LAT_DDMMDIR, "%f", "%08.3f%c" # (writes "5334.192S" giving -53.56987 degrees latitude) |
| 646 |
</screen> |
| 647 |
</para> |
| 648 |
</section> |
| 649 |
<section xml:id="style_def_lonnmea"> |
| 650 |
<title>LON_NMEA</title> |
| 651 |
<para>Defines the longitude in the format used by the NMEA standard which is |
| 652 |
degrees multiplied by 100 plus decimal minutes. |
| 653 |
</para> |
| 654 |
<para>Example: |
| 655 |
</para> |
| 656 |
<screen>IFIELD LON_NMEA, "%f", "%010.3f" # (writes -08708.082) |
| 657 |
</screen> |
| 658 |
</section> |
| 659 |
<section xml:id="style_def_londdmmdir"> |
| 660 |
<title>LON_DDMMDIR</title> |
| 661 |
<para>Derived from the LON_NMEA longitude format, with degrees * 100 plus decimal minutes, but using an additional character format character to position the |
| 662 |
'E' or 'W' instead of a leading minus sign (or absence thereof) to give direction from zero. |
| 663 |
</para> |
| 664 |
<para>Example: |
| 665 |
</para> |
| 666 |
<screen>IFIELD LON_DDMMDIR, "%f", "%010.3f%c" # (writes "01232.745W" giving -12.54575 degrees |
| 667 |
longitude) |
| 668 |
</screen> |
| 669 |
</section> |
| 670 |
<section xml:id="style_def_latlon_10ex"> |
| 671 |
<title>LAT_10EX / LON_10EX</title> |
| 672 |
<para>Defines the latitude or longitude in the format used i.e. by TomTom Navigator |
| 673 |
itinerary files. It is degrees multiplied by 10 power X. X have to be replaced with |
| 674 |
a valid decimal value. A factor of 10000 would be generated by LAT_10E5 as shown |
| 675 |
in the examples below. |
| 676 |
</para> |
| 677 |
<para>examples: |
| 678 |
</para> |
| 679 |
<screen>IFIELD LAT_10E5, "%f", "%.f" # (writes 3558322) |
| 680 |
</screen> |
| 681 |
<screen>IFIELD LON_10E5, "%f", "%.f" # (writes -8708082) |
| 682 |
</screen> |
| 683 |
</section> |
| 684 |
<section xml:id="style_def_utm"> |
| 685 |
<title>UTM</title> |
| 686 |
<para>A location in UTM has several components: a zone, a northing, and an easting. The UTM format specifier is the most common representation of these. |
| 687 |
</para> |
| 688 |
<para>example: </para> |
| 689 |
<screen>IFIELD UTM, "", "%s" # writes 6S 519045 3984035 -the easting is first by convention.</screen> |
| 690 |
</section> |
| 691 |
<section xml:id="style_def_utm_easting"> |
| 692 |
<title>UTM_EASTING</title> |
| 693 |
<para>This is the decimal component representing the easting |
| 694 |
</para> |
| 695 |
<para>example: </para> |
| 696 |
<screen>IFIELD UTM_EASTING, "", "%.0f" # outputs 519045 |
| 697 |
</screen> |
| 698 |
</section> |
| 699 |
<section xml:id="style_def_utm_northing"> |
| 700 |
<title>UTM_NORTHING</title> |
| 701 |
<para>This is the decimal component representing the northing |
| 702 |
</para> |
| 703 |
<para>example: </para> |
| 704 |
<screen>IFIELD UTM_NORTHING "", "%.0f" # outputs 3984035 |
| 705 |
</screen> |
| 706 |
</section> |
| 707 |
<section xml:id="style_def_utm_zone"> |
| 708 |
<title>UTM_ZONE</title> |
| 709 |
<para>The UTM zone. |
| 710 |
</para> |
| 711 |
<para>example: </para> |
| 712 |
<screen>IFIELD UTM_ZONE "", "%d" # outputs 6 |
| 713 |
</screen> |
| 714 |
</section> |
| 715 |
<section xml:id="style_def_utm_zonec"> |
| 716 |
<title>UTM_ZONEC</title> |
| 717 |
<para>The UTM Zone character. |
| 718 |
</para> |
| 719 |
<para>example: </para> |
| 720 |
<screen>IFIELD UTM_ZONEC "", "%c" # outputs S |
| 721 |
</screen> |
| 722 |
</section> |
| 723 |
<section xml:id="style_def_utm_zonef"> |
| 724 |
<title/> |
| 725 |
<para>The full UTM zone and latitude band. |
| 726 |
</para> |
| 727 |
<para>example: </para> |
| 728 |
<screen>IFIELD UTM_ZONEF "", "%d%c" # outputs 6S |
| 729 |
</screen> |
| 730 |
</section> |
| 731 |
<section xml:id="style_def_altfeet"> |
| 732 |
<title>ALT_FEET</title> |
| 733 |
<para>ALT_FEET is the position's ALTITUDE in FEET. This value is treated as |
| 734 |
a SIGNED DOUBLE PRECISION FLOAT and requires a FLOATING POINT printf |
| 735 |
conversion. |
| 736 |
</para> |
| 737 |
<para>example: |
| 738 |
</para> |
| 739 |
<screen>IFIELD ALT_FEET,"","%.0f" |
| 740 |
</screen> |
| 741 |
</section> |
| 742 |
<section xml:id="style_def_altmeters"> |
| 743 |
<title>ALT_METERS</title> |
| 744 |
<para>ALT_METERS is identical to ALT_FEET with the exception that the altitude |
| 745 |
is in METERS. |
| 746 |
</para> |
| 747 |
</section> |
| 748 |
<section xml:id="style_def_heartrate"> |
| 749 |
<title>HEART_RATE</title> |
| 750 |
<para>Heart rate, measured in beats per minute. Only valid for units with |
| 751 |
heart rate monitor features (i.e. Garmin Forerunner 301). |
| 752 |
</para> |
| 753 |
<para>example: |
| 754 |
</para> |
| 755 |
<screen>IFIELD HEART_RATE,"","%d" |
| 756 |
</screen> |
| 757 |
</section> |
| 758 |
<section xml:id="style_def_cadence"> |
| 759 |
<title>CADENCE</title> |
| 760 |
<para>Cadence in revolutions per minute. Only valid for units with |
| 761 |
heart rate monitor features (i.e. Garmin Edge 305). |
| 762 |
</para> |
| 763 |
<para>example: |
| 764 |
</para> |
| 765 |
<screen>IFIELD CADENCE,"","%d" |
| 766 |
</screen> |
| 767 |
</section> |
| 768 |
<section xml:id="style_def_power"> |
| 769 |
<title>POWER</title> |
| 770 |
<para>Cycling power in Watts. Only valid for units with power meter |
| 771 |
features (i.e. Garmin Edge 305). |
| 772 |
</para> |
| 773 |
<para>example: |
| 774 |
</para> |
| 775 |
<screen>IFIELD POWER,"","%.1f" |
| 776 |
</screen> |
| 777 |
</section> |
| 778 |
<section xml:id="style_def_temperature"> |
| 779 |
<title>TEMPERATURE</title> |
| 780 |
<para>Temperature in degrees Celsius. |
| 781 |
</para> |
| 782 |
<para>example: |
| 783 |
</para> |
| 784 |
<screen>IFIELD TEMPERATURE,"","%.1f" |
| 785 |
</screen> |
| 786 |
</section> |
| 787 |
<section xml:id="style_def_temperaturef"> |
| 788 |
<title>TEMPERATURE_F</title> |
| 789 |
<para>Temperature in degrees Fahrenheit. |
| 790 |
</para> |
| 791 |
<para>example: |
| 792 |
</para> |
| 793 |
<screen>IFIELD TEMPERATURE_F,"","%.1f" |
| 794 |
</screen> |
| 795 |
</section> |
| 796 |
<section xml:id="style_def_exceltime"> |
| 797 |
<title>EXCEL_TIME</title> |
| 798 |
<para>EXCEL_TIME is the waypoint's creation time, if any. This is actually |
| 799 |
the decimal days since 1/1/1900 and is handled internally as a DOUBLE |
| 800 |
PRECISION FLOAT and requires a FLOATING POINT printf conversion. |
| 801 |
</para> |
| 802 |
<para>example: |
| 803 |
</para> |
| 804 |
<screen>IFIELD EXCEL_TIME,"","%11.5f" |
| 805 |
</screen> |
| 806 |
</section> |
| 807 |
<section xml:id="style_def_timettime"> |
| 808 |
<title>TIMET_TIME</title> |
| 809 |
<para>TIMET_TIME is the waypoint's creation time, if any. This is actually |
| 810 |
the integer seconds since 1970-01-01T00:00:00 UTC. It |
| 811 |
is handled internally as a 64 bit integer and requires a LONG LONG INTEGER |
| 812 |
printf conversion. |
| 813 |
</para> |
| 814 |
<para>example: |
| 815 |
</para> |
| 816 |
<screen>IFIELD TIMET_TIME,"","%lld" |
| 817 |
</screen> |
| 818 |
</section> |
| 819 |
<section xml:id="style_def_timettimems"> |
| 820 |
<title>TIMET_TIME_MS</title> |
| 821 |
<para>TIMET_TIME_MS is the same as TIMET_TIME, but expressed in milliseconds. |
| 822 |
It too is handled internally as a 64 bit integer and requires a LONG LONG INTEGER |
| 823 |
printf conversion. |
| 824 |
</para> |
| 825 |
<para>example: |
| 826 |
</para> |
| 827 |
<screen>IFIELD TIMET_TIME_MS,"","%lld" |
| 828 |
</screen> |
| 829 |
</section> |
| 830 |
<section xml:id="style_def_yyyymmdd"> |
| 831 |
<title>YYYYMMDD_TIME</title> |
| 832 |
<para>YYYYMMDD_TIME is the waypoint's creation time in UTC, if any. It's a single |
| 833 |
decimal field containing four digits of year, two digits of month, |
| 834 |
and two digits of date. Internally it is a LONG INTEGER and thus |
| 835 |
requires a LONG INTEGER printf conversion. |
| 836 |
</para> |
| 837 |
<para>example: |
| 838 |
</para> |
| 839 |
<screen>IFIELD YYYYMMDD_TIME,"","%ld" |
| 840 |
</screen> |
| 841 |
</section> |
| 842 |
<section xml:id="style_def_gmttime"> |
| 843 |
<title>GMT_TIME</title> |
| 844 |
<para>GMT_TIME is the waypoint's creation time, in UTC time zone. It uses the |
| 845 |
strptime conversion format tags. |
| 846 |
It can be used to parse/print a date and time in one column, |
| 847 |
or a date in one column and a time in another column. If used to parse a date and a |
| 848 |
time in separate columns the date and time can be in either order. |
| 849 |
</para> |
| 850 |
<para>example with a a date followed by a time using a 12 hour clock and an AM/PM indication:</para> |
| 851 |
<screen>IFIELD GMT_TIME,"","%m/%d/%Y %I:%M:%S %p" |
| 852 |
</screen> |
| 853 |
<para>example with a a date followed by a time using a 24 hour clock:</para> |
| 854 |
<screen>IFIELD GMT_TIME,"","%Y/%m/%d" |
| 855 |
IFIELD GMT_TIME,"","%H:%M:%S" |
| 856 |
</screen> |
| 857 |
<para>Search the web for 'strptime man page' for details strptime, but one |
| 858 |
such page can be found at |
| 859 |
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.die.net/doc/linux/man/man3/strptime.3.html">http://www.die.net/doc/linux/man/man3/strptime.3.html</link></para> |
| 860 |
</section> |
| 861 |
<section xml:id="style_def_localtime"> |
| 862 |
<title>LOCAL_TIME</title> |
| 863 |
<para>LOCAL_TIME is the waypoint's creation time, in the local |
| 864 |
time zone. It uses strptime conversion format tags. |
| 865 |
It can be used to parse/print a date and time in one column, |
| 866 |
or a date in one column and a time in another column. If used to parse a date and a |
| 867 |
time in separate columns the date and time can be in either order. |
| 868 |
See GMT_TIME for examples and a reference. |
| 869 |
</para> |
| 870 |
</section> |
| 871 |
<section xml:id="style_def_isotime"> |
| 872 |
<title>ISO_TIME</title> |
| 873 |
<para>ISO_TIME is the waypoint's creation time, in ISO 8601 format, |
| 874 |
which include time zone information. |
| 875 |
It is expected to be in the format yyyy-mm-ddThh:mm:sszzzzz |
| 876 |
where zzzzzz is the local time offset or the character Z |
| 877 |
for UTC time. |
| 878 |
On output, UTC 'Z' time zone will always be used. |
| 879 |
</para> |
| 880 |
<para>example: |
| 881 |
</para> |
| 882 |
<screen>IFIELD ISO_TIME,"","%s" |
| 883 |
</screen> |
| 884 |
</section> |
| 885 |
<section xml:id="style_def_isotimems"> |
| 886 |
<title>ISO_TIME_MS</title> |
| 887 |
<para>ISO_TIME_MS is much like ISO_TIME, but expresses milliseconds at the |
| 888 |
end of the timestamp. |
| 889 |
It is thus in the format yyyy-mm-ddThh:mm:ss.SSSzzzzz |
| 890 |
where 'SSS' is milliseconds and zzzzzz is the local time offset |
| 891 |
or the character Z for UTC time. |
| 892 |
On output, UTC 'Z' time zone will always be used. |
| 893 |
</para> |
| 894 |
<para>example: |
| 895 |
</para> |
| 896 |
<screen>IFIELD ISO_TIME_MS,"","%s" |
| 897 |
</screen> |
| 898 |
</section> |
| 899 |
<section xml:id="style_def_nettime"> |
| 900 |
<title>NET_TIME</title> |
| 901 |
<para>Microsoft dot net represents times in 100 nanosecond intervals since midnight |
| 902 |
Jan 1/0001 GMT, giving absurdly large numbers like 633943150010000000 for |
| 903 |
mid-November, 2009. NET_TIME is how to represent those in GPSBabel. |
| 904 |
</para> |
| 905 |
<para>example: |
| 906 |
</para> |
| 907 |
<screen>IFIELD NET_TIME,"","%lld" |
| 908 |
</screen> |
| 909 |
</section> |
| 910 |
<section xml:id="style_def_geodiff"> |
| 911 |
<title>GEOCACHE_DIFF</title> |
| 912 |
<para>GEOCACHE_DIFF is valid only for geocaches and represents a DOUBLE |
| 913 |
PRECISION FLOAT. This is the geocache "difficulty" rating as defined by |
| 914 |
Groundspeak. A "three and a half star" cache would therefore be "3.5" |
| 915 |
</para> |
| 916 |
<para>example: |
| 917 |
</para> |
| 918 |
<screen>IFIELD GEOCACHE_DIFF,"","%3.1f" |
| 919 |
</screen> |
| 920 |
</section> |
| 921 |
<section xml:id="style_def_geoterr"> |
| 922 |
<title>GEOCACHE_TERR</title> |
| 923 |
<para>GEOCACHE_TERR is valid only for geocaches and represents a DOUBLE |
| 924 |
PRECISION FLOAT. This is the geocache "terrain" rating as defined |
| 925 |
by Groundspeak. A "three and a half star" cache would therefore be "3.5" |
| 926 |
</para> |
| 927 |
<para>example: |
| 928 |
</para> |
| 929 |
<screen>IFIELD GEOCACHE_TERR,"","%3.1f" |
| 930 |
</screen> |
| 931 |
</section> |
| 932 |
<section xml:id="style_def_geocontainer"> |
| 933 |
<title>GEOCACHE_CONTAINER</title> |
| 934 |
<para>GEOCACHE_CONTAINER is valid only for geocaches and is heavily influenced |
| 935 |
by the Groundspeak container types. Examples would include "Micro" |
| 936 |
and "Virtual". |
| 937 |
</para> |
| 938 |
<para>example: |
| 939 |
</para> |
| 940 |
<screen>GEOCACHE_CONTAINER,"","%s" |
| 941 |
</screen> |
| 942 |
</section> |
| 943 |
<section xml:id="style_def_geotype"> |
| 944 |
<title>GEOCACHE_TYPE</title> |
| 945 |
<para>GEOCACHE_TYPE is valid only for geocaches and is heavily influenced |
| 946 |
by the Groundspeak cache types. Examples would include "Event cache" |
| 947 |
and "Multi-Cache". |
| 948 |
</para> |
| 949 |
<para>example: |
| 950 |
</para> |
| 951 |
<screen>GEOCACHE_TYPE,"","%s" |
| 952 |
</screen> |
| 953 |
</section> |
| 954 |
<section xml:id="style_def_geoplacer"> |
| 955 |
<title>GEOCACHE_PLACER</title> |
| 956 |
<para>GEOCACHE_PLACER is a string containing the name of the placer of a |
| 957 |
geocache. |
| 958 |
</para> |
| 959 |
<para>example: |
| 960 |
</para> |
| 961 |
<screen>GEOCACHE_PLACER,"","%s" |
| 962 |
</screen> |
| 963 |
</section> |
| 964 |
<section xml:id="style_def_isavailable"> |
| 965 |
<title>GEOCACHE_ISAVAILABLE</title> |
| 966 |
<para>GEOCACHE_ISAVAILABLE is a string containing "True" or "False" |
| 967 |
indicating whether a geocache is currently available or not. |
| 968 |
</para> |
| 969 |
<para>example: |
| 970 |
</para> |
| 971 |
<screen>GEOCACHE_ISAVAILABLE,"","%s" |
| 972 |
</screen> |
| 973 |
</section> |
| 974 |
<section xml:id="style_def_isarchived"> |
| 975 |
<title>GEOCACHE_ISARCHIVED</title> |
| 976 |
<para>GEOCACHE_ISARCHIVED is a string containing "True" or "False" |
| 977 |
indicating whether a geocache has been archived. |
| 978 |
</para> |
| 979 |
<para>example: |
| 980 |
</para> |
| 981 |
<screen>GEOCACHE_ISARCHIVED,"","%s" |
| 982 |
</screen> |
| 983 |
</section> |
| 984 |
<section xml:id="style_def_geofound"> |
| 985 |
<title>GEOCACHE_LAST_FOUND</title> |
| 986 |
<para>A long integer in format YYYYMMDD containing the last time this geocache |
| 987 |
was found. |
| 988 |
</para> |
| 989 |
<para>example: |
| 990 |
</para> |
| 991 |
<screen>GEOCACHE_LAST_FOUND,"","%ld" |
| 992 |
</screen> |
| 993 |
</section> |
| 994 |
<section xml:id="style_def_geohint"> |
| 995 |
<title>GEOCACHE_HINT</title> |
| 996 |
<para>The hint for this geocache. No additional transformation (such as rot13) |
| 997 |
will be performed on this string. |
| 998 |
</para> |
| 999 |
<para>example: |
| 1000 |
</para> |
| 1001 |
<screen>GEOCACHE_HINT,"","%s" |
| 1002 |
</screen> |
| 1003 |
</section> |
| 1004 |
<section xml:id="style_def_pathdistmi"> |
| 1005 |
<title>PATH_DISTANCE_MILES</title> |
| 1006 |
<para>PATH_DISTANCE_MILES outputs the total length of the route or track from |
| 1007 |
the start point to the current point, in miles. This and the altitude |
| 1008 |
could be used to create an elevation profile. PATH_DISTANCE_MILES is |
| 1009 |
a DOUBLE PRECISION FLOAT. |
| 1010 |
</para> |
| 1011 |
<para>PATH_DISTANCE_MILES is not valid as an input field. |
| 1012 |
</para> |
| 1013 |
<para>PATH_DISTANCE_MILES is only meaningful if the data comes from a track |
| 1014 |
or a route; waypoint data will generate essentially meaningless output. |
| 1015 |
</para> |
| 1016 |
<para>example: |
| 1017 |
</para> |
| 1018 |
<screen>PATH_DISTANCE_MILES,"","%f" |
| 1019 |
</screen> |
| 1020 |
</section> |
| 1021 |
<section xml:id="style_def_pathdistnm"> |
| 1022 |
<title>PATH_DISTANCE_NAUTICAL_MILES</title> |
| 1023 |
<para>PATH_DISTANCE_NAUTICAL_MILES is like PATH_DISTANCE_MILES except it outputs the |
| 1024 |
length in nautical miles. |
| 1025 |
</para> |
| 1026 |
</section> |
| 1027 |
<section xml:id="style_def_pathdistkm"> |
| 1028 |
<title>PATH_DISTANCE_KM</title> |
| 1029 |
<para>PATH_DISTANCE_KM is like PATH_DISTANCE_MILES except it outputs the |
| 1030 |
length in kilometers. |
| 1031 |
</para> |
| 1032 |
</section> |
| 1033 |
<section xml:id="style_def_pathdistm"> |
| 1034 |
<title>PATH_DISTANCE_METERS</title> |
| 1035 |
<para>PATH_DISTANCE_METERS is like PATH_DISTANCE_MILES except it outputs the |
| 1036 |
length in meters. |
| 1037 |
</para> |
| 1038 |
</section> |
| 1039 |
<section xml:id="style_def_pathspeed"> |
| 1040 |
<title>PATH_SPEED</title> |
| 1041 |
<para>Speed in meters per second. GPSBabel does NOT calculate this data by |
| 1042 |
default; it is read from the input file if present. (If not present, |
| 1043 |
it may be calculated with the |
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
|
| 1048 |
|
| 1049 |
|
| 1050 |
<link linkend="filter_track">track</link> |
| 1051 |
filter.)</para> |
| 1052 |
<para>example: |
| 1053 |
</para> |
| 1054 |
<screen>PATH_SPEED,"","%f" |
| 1055 |
</screen> |
| 1056 |
</section> |
| 1057 |
<section xml:id="style_def_pathspeed_kph"> |
| 1058 |
<title>PATH_SPEED_KPH</title> |
| 1059 |
<para>Like PATH_SPEED but means kilometers per hour. |
| 1060 |
</para> |
| 1061 |
<para>example: |
| 1062 |
</para> |
| 1063 |
<screen>PATH_SPEED_KPH,"","%.1f" |
| 1064 |
</screen> |
| 1065 |
</section> |
| 1066 |
<section xml:id="style_def_pathspeed_mph"> |
| 1067 |
<title>PATH_SPEED_MPH</title> |
| 1068 |
<para>Like PATH_SPEED but means miles per hour. |
| 1069 |
</para> |
| 1070 |
<para>example: |
| 1071 |
</para> |
| 1072 |
<screen>PATH_SPEED_MPH,"","%.1f" |
| 1073 |
</screen> |
| 1074 |
</section> |
| 1075 |
<section xml:id="style_def_pathspeed_knots"> |
| 1076 |
<title>PATH_SPEED_KNOTS</title> |
| 1077 |
<para>Like PATH_SPEED but means knots (nautical). |
| 1078 |
</para> |
| 1079 |
<para>example: |
| 1080 |
</para> |
| 1081 |
<screen>PATH_SPEED_KNOTS,"","%.1f" |
| 1082 |
</screen> |
| 1083 |
</section> |
| 1084 |
<section xml:id="style_def_pathcourse"> |
| 1085 |
<title>PATH_COURSE</title> |
| 1086 |
<para>Course in degrees. GPSBabel does not calculate this data by default; |
| 1087 |
it is read from the input file if present. (If not present, it may be |
| 1088 |
calculated with the |
| 1089 |
|
| 1090 |
|
| 1091 |
|
| 1092 |
|
| 1093 |
|
| 1094 |
|
| 1095 |
<link linkend="filter_track">track</link> |
| 1096 |
filter.)</para> |
| 1097 |
<para>example: |
| 1098 |
</para> |
| 1099 |
<screen>PATH_COURSE,"","%f" |
| 1100 |
</screen> |
| 1101 |
</section> |
| 1102 |
<section xml:id="style_def_dop"> |
| 1103 |
<title>GPS_HDOP / GPS_VDOP / GPS_PDOP</title> |
| 1104 |
<para>GPS horizontal / vertical / positional dilution of precision |
| 1105 |
parameters. Needs float conversion. |
| 1106 |
</para> |
| 1107 |
<para>example: |
| 1108 |
</para> |
| 1109 |
<screen>GPS_HDOP,"","%f" |
| 1110 |
</screen> |
| 1111 |
</section> |
| 1112 |
<section xml:id="style_def_gpssat"> |
| 1113 |
<title>GPS_SAT</title> |
| 1114 |
<para>Number of satellites used for determination of the position. Needs |
| 1115 |
integer conversion. |
| 1116 |
</para> |
| 1117 |
<para>example: |
| 1118 |
</para> |
| 1119 |
<screen>GPS_SAT,"","%d" |
| 1120 |
</screen> |
| 1121 |
</section> |
| 1122 |
<section xml:id="style_def_gpsfix"> |
| 1123 |
<title>GPS_FIX</title> |
| 1124 |
<para>Type of fix (see GPX spec or |
| 1125 |
|
| 1126 |
|
| 1127 |
|
| 1128 |
|
| 1129 |
|
| 1130 |
|
| 1131 |
<link linkend="filter_track">track</link> |
| 1132 |
filter). Needs string conversion.</para> |
| 1133 |
<para>example: |
| 1134 |
</para> |
| 1135 |
<screen>GPS_FIX,"","%s" |
| 1136 |
</screen> |
| 1137 |
</section> |
| 1138 |
<section xml:id="style_track_new"> |
| 1139 |
<title>TRACK_NEW</title> |
| 1140 |
<para>If '1', it indicates that this trackpoint is the first point of a new track. Needs integer conversion.</para> |
| 1141 |
<para>example: |
| 1142 |
|
| 1143 |
|
| 1144 |
|
| 1145 |
|
| 1146 |
|
| 1147 |
|
| 1148 |
<screen>IFIELD TRACK_NEW,"","%d"</screen></para> |
| 1149 |
</section> |
| 1150 |
<section xml:id="style_track_name"> |
| 1151 |
<title>TRACK_NAME</title> |
| 1152 |
<para>The name of the track currently being operated on. Needs string conversion.</para> |
| 1153 |
<para>example: |
| 1154 |
|
| 1155 |
|
| 1156 |
|
| 1157 |
|
| 1158 |
|
| 1159 |
|
| 1160 |
<screen>TRACK_NAME, "", "%s"</screen></para> |
| 1161 |
</section> |
| 1162 |
<section xml:id="style_route_name"> |
| 1163 |
<title>ROUTE_NAME</title> |
| 1164 |
<para>The name of the route currently being operated on. Needs string conversion.</para> |
| 1165 |
<para>example: |
| 1166 |
<screen>ROUTE_NAME, "", "%s"</screen></para> |
| 1167 |
</section> |
| 1168 |
<section xml:id="style_street_addr"> |
| 1169 |
<title>STREET_ADDR</title> |
| 1170 |
<para>Street address including house number. Notice that this is not used for any geocoding, it's merely textual description associated with a position.</para> |
| 1171 |
<para>example: |
| 1172 |
|
| 1173 |
<screen>STREET_ADDR, "", "%s"</screen></para> |
| 1174 |
</section> |
| 1175 |
<section xml:id="style_city"> |
| 1176 |
<title>CITY</title> |
| 1177 |
<para>The name of a city. Sometimes part of "Points of Interest". This is simple textual data associated with a position, no geocoding will be done..</para> |
| 1178 |
<para>example: |
| 1179 |
<screen>CITY, "", "%s"</screen></para> |
| 1180 |
</section> |
| 1181 |
<section xml:id="style_country"> |
| 1182 |
<title>COUNTRY</title> |
| 1183 |
<para>The name of a country associated with a position.</para> |
| 1184 |
<para>example: |
| 1185 |
|
| 1186 |
|
| 1187 |
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
<screen>COUNTRY, "", "%s"</screen></para> |
| 1192 |
</section> |
| 1193 |
<section xml:id="style_email"> |
| 1194 |
<title>EMAIL</title> |
| 1195 |
<para>An email address associated with a position.</para> |
| 1196 |
<para>example: |
| 1197 |
|
| 1198 |
|
| 1199 |
|
| 1200 |
|
| 1201 |
|
| 1202 |
|
| 1203 |
<screen>EMAIL, "", "%s"</screen></para> |
| 1204 |
</section> |
| 1205 |
<section xml:id="style_facility"> |
| 1206 |
<title>FACILITY</title> |
| 1207 |
<para>The name of a facility to associate with a position.</para> |
| 1208 |
<para>example: |
| 1209 |
|
| 1210 |
|
| 1211 |
|
| 1212 |
|
| 1213 |
|
| 1214 |
|
| 1215 |
<screen>FACILITY, "", "%s"</screen></para> |
| 1216 |
</section> |
| 1217 |
<section xml:id="style_phone_nr"> |
| 1218 |
<title>PHONE_NR</title> |
| 1219 |
<para>A phone number associated with a position. This is just textual data attached for convenience.</para> |
| 1220 |
<para>example: |
| 1221 |
|
| 1222 |
|
| 1223 |
|
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
<screen>PHONE_NR, "", "%s"</screen></para> |
| 1228 |
</section> |
| 1229 |
<section xml:id="style_postal_code"> |
| 1230 |
<title>POSTAL_CODE</title> |
| 1231 |
<para>A postal code to associate with a position. It is freeform text and is not used by GPSBabel for any geocoding or such.</para> |
| 1232 |
<para>example: |
| 1233 |
|
| 1234 |
|
| 1235 |
|
| 1236 |
|
| 1237 |
|
| 1238 |
|
| 1239 |
<screen>POSTAL_CODE, "", "%s"</screen></para> |
| 1240 |
</section> |
| 1241 |
<section xml:id="style_filename"> |
| 1242 |
<title>FILENAME</title> |
| 1243 |
<para>The name of the input file from where the points were loaded. This field is available only on output.</para> |
| 1244 |
<para>example: |
| 1245 |
|
| 1246 |
|
| 1247 |
|
| 1248 |
|
| 1249 |
|
| 1250 |
|
| 1251 |
<screen>OFIELD FILENAME, "", "%s"</screen></para> |
| 1252 |
</section> |
| 1253 |
<section xml:id="style_format"> |
| 1254 |
<title>FORMAT</title> |
| 1255 |
<para>The name of the input format from where format the points came. This field is available only on output.</para> |
| 1256 |
<para>example: |
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
|
| 1261 |
|
| 1262 |
|
| 1263 |
<screen>OFIELD FORMAT, "", "%s"</screen></para> |
| 1264 |
</section> |
| 1265 |
</section> |
| 1266 |
<!-- definitions --> |
| 1267 |
<section xml:id="style_examples"> |
| 1268 |
<title>Examples</title> |
| 1269 |
<para>Here is one example style file from the GPSBabel source. |
| 1270 |
|
| 1271 |
|
| 1272 |
|
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
|
| 1277 |
<literallayout># gpsbabel XCSV style file |
| 1278 |
# |
| 1279 |
# Format: Garmin POI |
| 1280 |
# Author: Robert Lipe |
| 1281 |
# Date: 10/07/2005 |
| 1282 |
# Reference: http://forums.groundspeak.com/GC/index.php?showtopic=110641&st=0&#entry1752204 |
| 1283 |
# |
| 1284 |
DESCRIPTION Garmin POI database |
| 1285 |
# |
| 1286 |
# |
| 1287 |
# FILE LAYOUT DEFINITIIONS: |
| 1288 |
# |
| 1289 |
FIELD_DELIMITER COMMA |
| 1290 |
RECORD_DELIMITER NEWLINE |
| 1291 |
BADCHARS COMMA |
| 1292 |
SHORTLEN 24 |
| 1293 |
|
| 1294 |
# |
| 1295 |
# INDIVIDUAL DATA FIELDS, IN ORDER OF APPEARANCE: |
| 1296 |
# |
| 1297 |
IFIELD LON_HUMAN_READABLE, "", "%08.5f" |
| 1298 |
IFIELD LAT_HUMAN_READABLE, "", "%08.5f" |
| 1299 |
IFIELD SHORTNAME, "", "%s" |
| 1300 |
IFIELD DESCRIPTION, "", "%s" |
| 1301 |
|
| 1302 |
OFIELD LON_DECIMAL, "", "%08.5f" |
| 1303 |
OFIELD LAT_DECIMAL, "", "%08.5f" |
| 1304 |
OFIELD SHORTNAME, "", "%-.24s" |
| 1305 |
OFIELD GEOCACHE_TYPE, "", " %-.4s", "no_delim_before,optional" |
| 1306 |
OFIELD GEOCACHE_CONTAINER, "", "/%-.4s ", "no_delim_before,optional" |
| 1307 |
OFIELD GEOCACHE_DIFF, "", "(%3.1f", "no_delim_before,optional" |
| 1308 |
OFIELD GEOCACHE_TERR, "", "/%3.1f)", "no_delim_before,optional" |
| 1309 |
OFIELD DESCRIPTION, "", "%-.50s" |
| 1310 |
</literallayout> |
| 1311 |
When used on a Groundspeak Pocket Query, it will output lines that |
| 1312 |
look like: |
| 1313 |
|
| 1314 |
|
| 1315 |
<literallayout>-76.76234,38.39123,GC5370 Loca/Virt (1.0/1.0),Dude.. Wheres my Limo?? |
| 1316 |
-90.42345,38.55234,GCC8B Trad/Regu (2.0/2.0),Sweet Reward |
| 1317 |
-90.81456,38.62456,GC3091 Trad/Regu (1.5/2.0),Matson Hill |
| 1318 |
</literallayout> |
| 1319 |
that are suitable for Garmin's POI loader.</para> |
| 1320 |
<para>For additional examples, please see the |
| 1321 |
|
| 1322 |
|
| 1323 |
<filename>*.style</filename> |
| 1324 |
files in the |
| 1325 |
|
| 1326 |
|
| 1327 |
<filename>style/</filename> |
| 1328 |
subdirectory of the GPSBabel source tree or at the |
| 1329 |
|
| 1330 |
|
| 1331 |
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://github.com/gpsbabel/gpsbabel/tree/master/style">online source.</link> |
| 1332 |
.</para> |
| 1333 |
</section> |
| 1334 |
<!-- examples --> |
| 1335 |
<section xml:id="style_notes"> |
| 1336 |
<title>Miscellaneous Notes</title> |
| 1337 |
<section xml:id="style_notes_default"> |
| 1338 |
<title>Default Values</title> |
| 1339 |
<para>Default values are supported for any output fields that contain pure |
| 1340 |
character data output such as URL and NOTES. Default values are only |
| 1341 |
written on output and are not used to supplement missing input. When |
| 1342 |
using default values your mileage will vary greatly depending on the |
| 1343 |
input formats used to populate waypoint data. |
| 1344 |
</para> |
| 1345 |
</section> |
| 1346 |
</section> |
| 1347 |
<!-- notes --> |
| 1348 |
</appendix> |