You can define your own rules for color-coding GPX points and tracks.
How to Use
- Open the
Colortab in the Map window. - Select a JSON file under
User. Up to three files can be registered. - The rule's
Nameis added to theColor Codingchoices. - Select the desired rule under
Color Coding.
Overview
- Rules are defined using JSON files.
- One JSON file defines one color-coding rule.
- Colors are assigned from a palette.
- Numeric columns use
Bins;LabelandDescriptionuseMatches.
File Format
| Item | Description |
|---|---|
| Format | JSON |
| Encoding | UTF-8 (with or without BOM) |
| Key Names | Case-insensitive |
Root Structure - Top-Level JSON Keys
| Item | Type | Required | Description |
|---|---|---|---|
| FileType | String | Yes | File type identifier |
| Version | Integer | Yes | Format version |
| Name | String | Yes | Rule name |
| TargetColumn | String | Yes | Column to evaluate |
| Bins | Array | Conditional | Ranges for numeric columns |
| Matches | Array | Conditional | Match patterns for Label / Description |
| FallbackIndex | Integer | No | Condition index used when no pattern matches |
You cannot specify both Bins and
Matches in the same rule.
Field Specifications
| Item | Type | Value / Description | Notes |
|---|---|---|---|
| FileType | String | "TurboGPX.ColorRule" |
Fixed value |
| Version | Integer | 1 |
|
| Name | String | Any rule name | Shown in the UI |
| TargetColumn | String | Column name | Example: "Gap" |
| FallbackIndex | Integer | 1 to the number of conditions |
1-based; defaults to the first condition when omitted |
TargetColumn
| Value | Condition Type | Meaning |
|---|---|---|
| Elevation | Bins | Elevation |
| Speed | Bins | Speed |
| Distance | Bins | Distance |
| Gap | Bins | Distance gap |
| Slope | Bins | Slope |
| Label | Matches | Label |
| Description | Matches | Description |
The column name matches even if the displayed header includes
units such as Speed(km/h).
Bins Elements
Use Bins to define numeric ranges.
| Item | Type | Required | Description |
|---|---|---|---|
| Min | Number | Yes | Inclusive minimum |
| Max | Number | Yes | Inclusive maximum |
Ranges are tested in order, with
Min <= value <= Max. When several ranges match,
the first matching element is used.
Matches Elements
Use Matches for Label / Description rules.
| Item | Type | Required | Description |
|---|---|---|---|
| Pattern | String | Yes | Text match pattern |
Patterns are matched against the full string. *
matches zero or more characters; ? matches exactly
one arbitrary character.
FallbackIndex
The index used if no conditions match. It is
1-based in JSON. To use the first
Bins or Matches item, specify
1.
Numeric Column Example
{
"FileType": "TurboGPX.ColorRule",
"Version": 1,
"Name": "Speed (JSON)",
"TargetColumn": "Speed",
"Bins": [
{ "Min": 0.0, "Max": 9.9 },
{ "Min": 10.0, "Max": 19.9 },
{ "Min": 20.0, "Max": 29.9 }
],
"FallbackIndex": 1
}Text Column Example
{
"FileType": "TurboGPX.ColorRule",
"Version": 1,
"Name": "Label (JSON)",
"TargetColumn": "Label",
"Matches": [
{ "Pattern": "START*" },
{ "Pattern": "CHECK?" },
{ "Pattern": "*" }
],
"FallbackIndex": 3
}