﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16796	[PATCH] GPX track colors / layer preferences	Bjoeni	Bjoeni	"Hi,

just some thoughts on colors in GPX files / tracks...

Currently they can only be defined for the whole layer and are not saved, but the filename / name of the layer is put in the preferences and associated with a color... which doesn't really seem like a good idea to me. I have like tons of dead GPX file settings in my preferences (all of those `clr.layer.*` settings), and files with similar filenames can lead to problems. They should actually be saved in the file or that should imo at least be an option when saving.

The [https://www.topografix.com/gpx/1/1/gpx.xsd default GPX schema] doesn't allow that, but it is extensible, e.g. the [https://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd Garmin GPX extensions] supports (very few) DisplayColors:
{{{
#!xml
<xsd:element name=""DisplayColor"" type=""DisplayColor_t"" minOccurs=""0""/>
}}}
{{{
#!xml
  <xsd:simpleType name=""DisplayColor_t"">
    <xsd:restriction base=""xsd:token"">
      <xsd:enumeration value=""Black""/>
      <xsd:enumeration value=""DarkRed""/>
      <xsd:enumeration value=""DarkGreen""/>
      <xsd:enumeration value=""DarkYellow""/>
      <xsd:enumeration value=""DarkBlue""/>
      <xsd:enumeration value=""DarkMagenta""/>
      <xsd:enumeration value=""DarkCyan""/>
      <xsd:enumeration value=""LightGray""/>
      <xsd:enumeration value=""DarkGray""/>
      <xsd:enumeration value=""Red""/>
      <xsd:enumeration value=""Green""/>
      <xsd:enumeration value=""Yellow""/>
      <xsd:enumeration value=""Blue""/>
      <xsd:enumeration value=""Magenta""/>
      <xsd:enumeration value=""Cyan""/>
      <xsd:enumeration value=""White""/>
      <xsd:enumeration value=""Transparent""/>
    </xsd:restriction>
  </xsd:simpleType>
}}}
Which will look like this:
{{{
#!xml
    <extensions>
      <gpxx:TrackExtension>
        <gpxx:DisplayColor>Magenta</gpxx:DisplayColor>
      </gpxx:TrackExtension>
    </extensions>
}}}

OsmAnd just uses a [https://github.com/osmandapp/Osmand/issues/3345 non-standard extension] like
{{{
#!xml
<extensions>
  <color>#aafaf700</color>
</extensions>
}}}
That however doesn't seem to be documented anywhere else and won't pass validation as [https://github.com/osmandapp/Osmand/issues/3345#issuecomment-394922835 pointed out on GitHub by baerrus].


**How do you see that?**
- Where do colors and other settings for specific GPX layers belong? Preferences or layer, i.e. GPX file.
- Should colors only be defined for segments/tracks or for entire files/layers? This makes a difference e.g. when merging.
- In case we agree that they mainly belong in the file or that it should at least be possible to save them, how could they be saved? Possibly creating an own open GPX extension, maybe together with the guys from OsmAnd in order to produce valid GPX files? (not just limited to the color, but also (drawing) features other programs like OsmAnd could use or that could be implemented in the future [width, opacity, dotted lines, ...])

I haven't really thought all of that through, those are just ideas to be discussed. In my opinion the current method of saving layer specific settings in the preferences related to the name just doesn't seem right (settings/colors are even lost when the layer is renamed within JOSM)."	enhancement	closed	major	19.11	Core		fixed	gpx, file, color, schema, preferences	stoecker michael2402 ris
