+fn parse_coordinate_q(s: &[u8]) -> Fixed {
+ // Find the position of the decimal separator for the minutes.
+ let dot_position_o = s.iter().enumerate().find(|(_, &c)| {
+ c == b'.'
+ }).and_then(|(i, _)| {
+ Some(i)
+ });
+
+ if dot_position_o.is_none() {
+ return Fixed::from_i64(0);
+ }
+
+ let dot_position = dot_position_o.unwrap();
+
+ // Minutes take two digits before the decimal separator.
+ let num_degree_digits = dot_position - 2;
+
+ let degrees = s[0..num_degree_digits].iter().fold(0, |d, c| {
+ (d * 10) + (c - b'0') as i32
+ });
+
+ let minutes = s[num_degree_digits..dot_position].iter().fold(0, |d, c| {
+ (d * 10) + (c - b'0') as i32
+ });
+
+ let decimal_minutes = s[dot_position + 1..].iter().fold(0, |d, c| {
+ (d * 10) + (c - b'0') as i32
+ });
+
+ let mut result = Fixed::from_i64(decimal_minutes.into());
+ result /= Fixed::from_i64(10000);
+
+ result += Fixed::from_i64(minutes.into());
+ result /= Fixed::from_i64(60);
+
+ result += Fixed::from_i64(degrees.into());
+
+ return result;
+}
+