﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
20600	"[Patch] Color NMEA and GPX files by ""fix"" value"	pyrog	team	"Hi,

NMEA tracks recorded by a RTK receiver already store the fix type (Single, RTK float, RTK fix).
This value is converted to text and stored in GpxConstants.PT_FIX field.

Unfortunately, this field is not used to set the colour of GPX track.
Doing this directly in JOSM would be great feature.


- GGA quality text conversion and stored in **GpxConstants.PT_FIX** field [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java#L396 NmeaReader.java#L396]
- RTKlib quality stored in **GpxConstants.RTKLIB_Q** field [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java#L94 RtkLibPosReader.java#L94]
- Colour selected **GpxConstants.RTKLIB_Q** in ColorMode.QUALITY  [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java#L595 GpxDrawHelper.java#L595]

Both RTKLib and NMEA track could ""share"" the same quality field internally ?
||= RTK Lib =||= NMEA =||= Meaning =||
|| 0 || 0 || None ? || 
|| 1 || 4 || Fix RTK || 
|| 2 || 5 || Float RTK || 
|| 3 || ? || SBAS ||
|| 4 || 2 || D-GPS || 
|| 5 || 1 || Single || 
|| 6 || 3 || PPK || 


Source: [https://josm.openstreetmap.de/ticket/17829 ticket #17829]
{{{
When you look at a solution in rtkplot, the first thing you look is the points' colors.
The Q value set the color and the default one are:
Q=1 (fix) -> Green
Q=2 (float) -> Orange
Q=3 (sbas) -> Pink
Q=4 (dgps) -> Blue
Q=5 (single) -> Red
Q=6 (ppp) -> Light Blue
}}}

Source: [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java#L396 NmeaReader.java#L396]
{{{#!java
// fix
accu = e[GGA.QUALITY.position];
if (!accu.isEmpty()) {
	int fixtype = Integer.parseInt(accu);
	switch(fixtype) {
	case 0:
		currentwp.put(GpxConstants.PT_FIX, ""none"");
		break;
	case 1:
		if (sat < 4) {
			currentwp.put(GpxConstants.PT_FIX, ""2d"");
		} else {
			currentwp.put(GpxConstants.PT_FIX, ""3d"");
		}
		break;
	case 2:
		currentwp.put(GpxConstants.PT_FIX, ""dgps"");
		break;
	case 3:
		currentwp.put(GpxConstants.PT_FIX, ""pps"");
		break;
	case 4:
		currentwp.put(GpxConstants.PT_FIX, ""rtk"");
		break;
	case 5:
		currentwp.put(GpxConstants.PT_FIX, ""float rtk"");
		break;
	case 6:
		currentwp.put(GpxConstants.PT_FIX, ""estimated"");
		break;
	case 7:
		currentwp.put(GpxConstants.PT_FIX, ""manual"");
		break;
	case 8:
		currentwp.put(GpxConstants.PT_FIX, ""simulated"");
		break;
	default:
		break;
	}
}
}}}
 "	enhancement	closed	normal	22.03	Core	tested	fixed	NMEA GPX Fix RTK color	
