protected void writeHeader(PrintWriter writer) {
writer.println(HEADER_LINE);
}
protected void writePosition(NmeaPosition position, PrintWriter writer) {
ValueAndOrientation longitudeAsValueAndOrientation = position.getLongitudeAsValueAndOrientation();
String longitude = formatLongitude(longitudeAsValueAndOrientation.getValue());
String westOrEast = longitudeAsValueAndOrientation.getOrientation().value();
ValueAndOrientation latitudeAsValueAndOrientation = position.getLatitudeAsValueAndOrientation();
String latitude = formatLatitude(latitudeAsValueAndOrientation.getValue());
String northOrSouth = latitudeAsValueAndOrientation.getOrientation().value();
String description = escape(position.getDescription(), SEPARATOR, ';');
String altitude = formatIntAsString(position.getElevation() != null ? position.getElevation().intValue() : null);
String wpl = "PMGNWPL" + SEPARATOR +
latitude + SEPARATOR + northOrSouth + SEPARATOR + longitude + SEPARATOR + westOrEast + SEPARATOR +