Index: src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php
===================================================================
--- src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php	(revision f29f4d3f0ecc752467eaceafe4a0697716a944e1)
+++ src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php	(revision 1c07566a91c62597f0919f9965d948a9829a7d9e)
@@ -55,9 +55,9 @@
 			$this->_status = Nmea0183RmcStatus::A;
 		
-		$this->_latitude = Nmea0183Rmc::nmeaToDecimalDegrees($content[3]);
+		$this->_latitude = Nmea0183Rmc::nmeaLatitudeToDecimalDegrees($content[3]);
 		if(Nmea0183Rmc::directionToEnum($content[4]) == Nmea0183Direction::South)
 			$this->_latitude = $this->_latitude * -1;
 		
-		$this->_longitude = Nmea0183Rmc::nmeaToDecimalDegrees($content[5]);
+		$this->_longitude = Nmea0183Rmc::nmeaLongitudeToDecimalDegrees($content[5]);
 		if(Nmea0183Rmc::directionToEnum($content[6]) == Nmea0183Direction::West)
 			$this->_longitude = $this->_longitude * -1;
@@ -162,5 +162,5 @@
 	}
 	
-	private static function nmeaToDecimalDegrees($nmeaValue)
+	private static function nmeaLatitudeToDecimalDegrees($nmeaValue)
 	{
 		if((float)$nmeaValue == 0)
@@ -168,10 +168,8 @@
 
 		$matches = array();
-		$result = preg_match('/^([0-9]+)([0-9]{2}\.[0-9]+)$/', $nmeaValue, $matches);
+		$result = preg_match('/^([0-9]{2})([0-9]{2}\.[0-9]+)$/', $nmeaValue, $matches);
 		if($result === false || $result != 1 || count($matches) != 3){
-			$message = "Could not convert nmea position into decimal degress ". $nmeaValue;
+			$message = "Could not convert nmea latitude position into decimal degress ". $nmeaValue;
 			error_log($message);
-			if($debug > 0)
-				print $message ."\n";
 			return 0;
 		}
@@ -180,5 +178,22 @@
 		return $decimalDegrees + ($decimalMinutes / 60.0);
 	}
-	
+
+	private static function nmeaLongitudeToDecimalDegrees($nmeaValue)
+	{
+		if((float)$nmeaValue == 0)
+			return 0;
+
+		$matches = array();
+		$result = preg_match('/^([0-9]{3})([0-9]{2}\.[0-9]+)$/', $nmeaValue, $matches);
+		if($result === false || $result != 1 || count($matches) != 3){
+			$message = "Could not convert nmea longitude position into decimal degress ". $nmeaValue;
+			error_log($message);
+			return 0;
+		}
+		$decimalDegrees = (float)$matches[1];
+		$decimalMinutes = (float)$matches[2];
+		return $decimalDegrees + ($decimalMinutes / 60.0);
+	}
+
 	private $_dateTimeUtc;
 	private $_status;
