Index: src/org/openstreetmap/josm/actions/OpenAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/OpenAction.java	(Revision 736)
+++ src/org/openstreetmap/josm/actions/OpenAction.java	(Arbeitskopie)
@@ -17,11 +17,12 @@
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
+import org.openstreetmap.josm.io.GpxReader;
+import org.openstreetmap.josm.io.NmeaReader;
 import org.openstreetmap.josm.io.OsmReader;
-import org.openstreetmap.josm.io.GpxReader;
 import org.xml.sax.SAXException;
 
 /**
@@ -55,6 +56,8 @@
 		try {
 			if (asGpxData(file.getName()))
 				openFileAsGpx(file);
+			else if (asNmeaData(file.getName()))
+				openFileAsNmea(file);
 			else
 				openAsData(file);
 		} catch (SAXException x) {
@@ -102,10 +105,32 @@
 		}
     }
 
+	private void openFileAsNmea(File file) throws IOException, FileNotFoundException {
+		String fn = file.getName();
+		if (ExtensionFileFilter.filters[ExtensionFileFilter.NMEA].acceptName(fn)) {
+			NmeaReader r = new NmeaReader(new FileInputStream(file), file.getAbsoluteFile().getParentFile());
+			r.data.storageFile = file;
+			GpxLayer gpxLayer = new GpxLayer(r.data, fn);
+			Main.main.addLayer(gpxLayer);
+			if (Main.pref.getBoolean("marker.makeautomarkers", true)) {
+				MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), file, gpxLayer);
+				if (ml.data.size() > 0) {
+					Main.main.addLayer(ml);
+				}
+			}
 
+		} else {
+			throw new IllegalStateException();
+		}
+    }
+
 	private boolean asGpxData(String fn) {
 		return ExtensionFileFilter.filters[ExtensionFileFilter.GPX].acceptName(fn);
 	}
 
+	private boolean asNmeaData(String fn) {
+		return ExtensionFileFilter.filters[ExtensionFileFilter.NMEA].acceptName(fn);
+	}
 
+
 }
Index: src/org/openstreetmap/josm/actions/ExtensionFileFilter.java
===================================================================
--- src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(Revision 736)
+++ src/org/openstreetmap/josm/actions/ExtensionFileFilter.java	(Arbeitskopie)
@@ -20,10 +20,12 @@
 
 	public static final int OSM = 0;
 	public static final int GPX = 1;
+	public static final int NMEA = 2;
 	
 	public static ExtensionFileFilter[] filters = {
 		new ExtensionFileFilter("osm,xml", "osm", tr("OSM Server Files (.osm .xml)")),
 		new ExtensionFileFilter("gpx,gpx.gz", "gpx", tr("GPX Files (.gpx .gpx.gz)")),
+		new ExtensionFileFilter("nmea", "nmea", tr("NMEA-0183 Files (.nmea)")),
 	};
 
 	/**
Index: src/org/openstreetmap/josm/io/NmeaReader.java
===================================================================
--- src/org/openstreetmap/josm/io/NmeaReader.java	(Revision 0)
+++ src/org/openstreetmap/josm/io/NmeaReader.java	(Revision 0)
@@ -0,0 +1,203 @@
+//License: GPL. Copyright 2008 by Christoph Brill
+
+package org.openstreetmap.josm.io;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.openstreetmap.josm.data.gpx.GpxTrack;
+import org.openstreetmap.josm.data.gpx.WayPoint;
+
+/**
+ * Read a nmea file. Based on information from
+ * http://www.kowoma.de/gps/zusatzerklaerungen/NMEA.htm
+ * 
+ * @author cbrill
+ */
+public class NmeaReader {
+
+	/** Handler for the different types that NMEA speaks. */
+	public static enum NMEA_TYPE {
+
+		/** RMC = recommended minimum sentence C. */
+		GPRMC("$GPRMC"),
+		/** GPS positions. */
+		GPGGA("$GPGGA"),
+		/** SA = satellites active. */
+		GPGSA("$GPGSA");
+
+		private final String type;
+
+		NMEA_TYPE(String type) {
+			this.type = type;
+		}
+
+		public String getType() {
+	        return this.type;
+        }
+
+		public boolean equals(String type) {
+			return this.type.equals(type);
+		}
+	}
+
+	private static final int TYPE = 0;
+	
+	// The following only applies to GPRMC
+	public static enum GPRMC {
+		TIME(1),
+		/** Warning from the receiver (A = data ok, V = warning) */
+		RECEIVER_WARNING(2),
+		WIDTH_NORTH(3),
+		WIDTH_NORTH_NAME(4),
+		LENGTH_EAST(5),
+		LENGTH_EAST_NAME(6),
+		/** Speed in knots */
+		SPEED(7),
+		COURSE(8),
+		DATE(9),
+		/** magnetic declination */
+		MAGNETIC_DECLINATION(10),
+		UNKNOWN(11),
+		/** Mode (A = autonom; D = differential; E = estimated; N = not valid; S = simulated)
+		 * @since NMEA 2.3 */
+		MODE(12);
+
+		public final int position;
+
+		GPRMC(int position) {
+			this.position = position;
+		}
+	}
+
+	// The following only applies to GPGGA
+	public static enum GPGGA {
+		TIME(1),
+		LATITUDE(2),
+		LATITUDE_NAME(3),
+		LONGITUDE(4),
+		LONGITUDE_NAME(5),
+		/** Quality (0 = invalid, 1 = GPS, 2 = DGPS, 6 = estimanted (@since NMEA 2.3)) */
+		QUALITY(6),
+		SATELLITE_COUNT(7),
+		/** HDOP (horizontal dilution of precision) */
+		HDOP(8),
+		/** height above NN (above geoid) */
+		HEIGHT(9),
+		HEIGHT_UNTIS(10),
+		/** height geoid - height ellipsoid (WGS84) */
+		HEIGHT_2(11),
+		HEIGHT_2_UNTIS(12);
+
+		public final int position;
+
+		GPGGA(int position) {
+			this.position = position;
+		}
+	}
+
+	// The following only applies to GPGGA
+	public static enum GPGSA {
+		AUTOMATIC(1),
+		/** 1 = not fixed, 2 = 2D fixed, 3 = 3D fixed) */
+		FIX_TYPE(2),
+		// PRN numbers for max 12 satellites
+		PRN_1(3),
+		PRN_2(4),
+		PRN_3(5),
+		PRN_4(6),
+		PRN_5(7),
+		PRN_6(8),
+		PRN_7(9),
+		PRN_8(10),
+		PRN_9(11),
+		PRN_10(12),
+		PRN_11(13),
+		PRN_12(14),
+		/** PDOP (precision) */
+		PDOP(15),
+		/** HDOP (horizontal precision) */
+		HDOP(16),
+		/** VDOP (vertical precision) */
+		VDOP(17),
+		;
+		
+		public final int position;
+
+		GPGSA(int position) {
+			this.position = position;
+		}
+	}
+
+	public GpxData data;
+
+	public NmeaReader(InputStream source, File relativeMarkerPath) {
+		data = new GpxData();
+		GpxTrack currentTrack = new GpxTrack();
+		Collection<WayPoint> currentTrackSeg = new ArrayList<WayPoint>();
+		currentTrack.trackSegs.add(currentTrackSeg);
+		data.tracks.add(currentTrack);
+
+		BufferedReader rd;
+		String nmeaWithChecksum;
+
+		Calendar lastKnownDate = null;
+		try {
+			rd = new BufferedReader(new InputStreamReader(source));
+			while ((nmeaWithChecksum = rd.readLine()) != null) {
+				String[] nmeaAndChecksum = nmeaWithChecksum.split("\\*");
+				String nmea = nmeaAndChecksum[0];
+				String checksum = nmeaAndChecksum[1];
+				String[] e = nmea.split(",");
+				if (NMEA_TYPE.GPGGA.equals(e[TYPE])) {
+					WayPoint currentWayPoint = new WayPoint(parseLatLon(e));
+
+					if (lastKnownDate != null) {
+						try {
+							Date time;
+							if (e[GPGGA.TIME.position].contains(".")) {
+								time = new SimpleDateFormat("HHmmss.SSS").parse(e[GPGGA.TIME.position]);
+							} else {
+								time = new SimpleDateFormat("HHmmss").parse(e[GPGGA.TIME.position]);
+							}
+							Calendar cal = Calendar.getInstance();
+							cal.setTime(time);
+							cal.set(lastKnownDate.get(Calendar.YEAR), lastKnownDate.get(Calendar.MONTH), lastKnownDate.get(Calendar.DAY_OF_MONTH));
+							currentWayPoint.time = cal.getTimeInMillis() / 1000.0;
+                        } catch (ParseException e1) {
+	                        e1.printStackTrace();
+                        }
+					}
+					currentTrackSeg.add(currentWayPoint);
+				} else if (NMEA_TYPE.GPRMC.equals(e[TYPE])) {
+					try {
+	                    Date date = new SimpleDateFormat("ddMMyy").parse(e[GPRMC.DATE.position]);
+	                    lastKnownDate = Calendar.getInstance();
+	                    lastKnownDate.setTime(date);
+                    } catch (ParseException e1) {
+                    	// Don't care
+                    }
+				}
+			}
+			rd.close();
+		} catch (final IOException e) {
+			System.out.println("Error reading file");
+		}
+
+	}
+
+	private LatLon parseLatLon(String[] e) {
+	    return new LatLon(Double.parseDouble(e[GPGGA.LATITUDE.position]), Double.parseDouble(e[GPGGA.LONGITUDE.position]));
+    }
+}
