Index: trunk/src/org/openstreetmap/josm/gui/io/importexport/NMEAImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/importexport/NMEAImporter.java	(revision 14009)
+++ trunk/src/org/openstreetmap/josm/gui/io/importexport/NMEAImporter.java	(revision 14010)
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.io.nmea.NmeaReader;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.xml.sax.SAXException;
 
 /**
@@ -48,8 +49,8 @@
         final String fn = file.getName();
         try (InputStream fis = Compression.getUncompressedFileInputStream(file)) {
-            final NmeaReader r = new NmeaReader(fis);
+            final NmeaReader r = buildAndParse(fis);
             if (r.getNumberOfCoordinates() > 0) {
-                r.data.storageFile = file;
-                final GpxLayer gpxLayer = new GpxLayer(r.data, fn, true);
+                r.getGpxData().storageFile = file;
+                final GpxLayer gpxLayer = new GpxLayer(r.getGpxData(), fn, true);
                 final File fileFinal = file;
 
@@ -57,5 +58,5 @@
                     MainApplication.getLayerManager().addLayer(gpxLayer);
                     if (Config.getPref().getBoolean("marker.makeautomarkers", true)) {
-                        MarkerLayer ml = new MarkerLayer(r.data, tr("Markers from {0}", fn), fileFinal, gpxLayer);
+                        MarkerLayer ml = new MarkerLayer(r.getGpxData(), tr("Markers from {0}", fn), fileFinal, gpxLayer);
                         if (!ml.data.isEmpty()) {
                             MainApplication.getLayerManager().addLayer(ml);
@@ -103,8 +104,18 @@
     public static GpxImporterData loadLayers(InputStream is, final File associatedFile,
             final String gpxLayerName, String markerLayerName) throws IOException {
-        final NmeaReader r = new NmeaReader(is);
+        final NmeaReader r = buildAndParse(is);
         final boolean parsedProperly = r.getNumberOfCoordinates() > 0;
-        r.data.storageFile = associatedFile;
-        return GpxImporter.loadLayers(r.data, parsedProperly, gpxLayerName, markerLayerName);
+        r.getGpxData().storageFile = associatedFile;
+        return GpxImporter.loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
+    }
+
+    static NmeaReader buildAndParse(InputStream fis) throws IOException {
+        final NmeaReader r = new NmeaReader(fis);
+        try {
+            r.parse(true);
+        } catch (SAXException e) {
+            throw new IOException(e);
+        }
+        return r;
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14009)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 14010)
@@ -23,9 +23,9 @@
 import java.io.IOException;
 import java.io.InputStream;
-import java.nio.file.Files;
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -38,5 +38,4 @@
 import java.util.TimeZone;
 import java.util.concurrent.TimeUnit;
-import java.util.zip.GZIPInputStream;
 
 import javax.swing.AbstractAction;
@@ -60,8 +59,8 @@
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
-import javax.swing.filechooser.FileFilter;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.DiskAccessAction;
+import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.data.gpx.GpxConstants;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -72,11 +71,17 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.io.importexport.GpxImporter;
 import org.openstreetmap.josm.gui.io.importexport.JpgImporter;
+import org.openstreetmap.josm.gui.io.importexport.NMEAImporter;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.gui.widgets.AbstractFileChooser;
+import org.openstreetmap.josm.gui.widgets.FileChooserManager;
 import org.openstreetmap.josm.gui.widgets.JosmComboBox;
 import org.openstreetmap.josm.gui.widgets.JosmTextField;
+import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.GpxReader;
+import org.openstreetmap.josm.io.IGpxReader;
+import org.openstreetmap.josm.io.nmea.NmeaReader;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.GBC;
@@ -85,5 +90,4 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
-import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.date.DateUtils;
 import org.xml.sax.SAXException;
@@ -251,17 +255,8 @@
 
         @Override
-        public void actionPerformed(ActionEvent arg0) {
-            FileFilter filter = new FileFilter() {
-                @Override
-                public boolean accept(File f) {
-                    return f.isDirectory() || Utils.hasExtension(f, "gpx", "gpx.gz");
-                }
-
-                @Override
-                public String getDescription() {
-                    return tr("GPX Files (*.gpx *.gpx.gz)");
-                }
-            };
-            AbstractFileChooser fc = DiskAccessAction.createAndOpenFileChooser(true, false, null, filter, JFileChooser.FILES_ONLY, null);
+        public void actionPerformed(ActionEvent e) {
+            ExtensionFileFilter gpxFilter = GpxImporter.getFileFilter();
+            AbstractFileChooser fc = new FileChooserManager(true, null).createFileChooser(false, null,
+                    Arrays.asList(gpxFilter, NMEAImporter.FILE_FILTER), gpxFilter, JFileChooser.FILES_ONLY).openFileChooser();
             if (fc == null)
                 return;
@@ -287,6 +282,6 @@
                 }
                 GpxData data = null;
-                try (InputStream iStream = createInputStream(sel)) {
-                    GpxReader reader = new GpxReader(iStream);
+                try (InputStream iStream = Compression.getUncompressedFileInputStream(sel)) {
+                    IGpxReader reader = gpxFilter.accept(sel) ? new GpxReader(iStream) : new NmeaReader(iStream);
                     reader.parse(false);
                     data = reader.getGpxData();
@@ -327,12 +322,4 @@
             }
         }
-
-        private InputStream createInputStream(File sel) throws IOException {
-            if (Utils.hasExtension(sel, "gpx.gz")) {
-                return new GZIPInputStream(Files.newInputStream(sel.toPath()));
-            } else {
-                return Files.newInputStream(sel.toPath());
-            }
-        }
     }
 
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 14009)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 14010)
@@ -42,5 +42,5 @@
  * @author imi, ramack
  */
-public class GpxReader implements GpxConstants {
+public class GpxReader implements GpxConstants, IGpxReader {
 
     private enum State {
@@ -579,4 +579,5 @@
      * @throws IOException if any I/O error occurs
      */
+    @Override
     public boolean parse(boolean tryToFinish) throws SAXException, IOException {
         Parser parser = new Parser();
@@ -604,8 +605,5 @@
     }
 
-    /**
-     * Replies the GPX data.
-     * @return The GPX data
-     */
+    @Override
     public GpxData getGpxData() {
         return gpxData;
Index: trunk/src/org/openstreetmap/josm/io/IGpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/IGpxReader.java	(revision 14010)
+++ trunk/src/org/openstreetmap/josm/io/IGpxReader.java	(revision 14010)
@@ -0,0 +1,32 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+import java.io.IOException;
+
+import org.openstreetmap.josm.data.gpx.GpxData;
+import org.xml.sax.SAXException;
+
+/**
+ * Abstraction of {@code GpxReader} and {@code NmeaReader}.
+ * @since 14010
+ */
+public interface IGpxReader {
+
+    /**
+     * Parse the GPX data.
+     *
+     * @param tryToFinish true, if the reader should return at least part of the GPX
+     * data in case of an error.
+     * @return true if file was properly parsed, false if there was error during
+     * parsing but some data were parsed anyway
+     * @throws SAXException if any SAX parsing error occurs
+     * @throws IOException if any I/O error occurs
+     */
+    boolean parse(boolean tryToFinish) throws SAXException, IOException;
+
+    /**
+     * Replies the GPX data.
+     * @return The GPX data
+     */
+    GpxData getGpxData();
+}
Index: trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 14009)
+++ trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java	(revision 14010)
@@ -14,4 +14,5 @@
 import java.util.Date;
 import java.util.Locale;
+import java.util.Objects;
 import java.util.Optional;
 
@@ -21,7 +22,9 @@
 import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
 import org.openstreetmap.josm.data.gpx.WayPoint;
+import org.openstreetmap.josm.io.IGpxReader;
 import org.openstreetmap.josm.io.IllegalDataException;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.date.DateUtils;
+import org.xml.sax.SAXException;
 
 /**
@@ -40,5 +43,5 @@
  * @author cbrill
  */
-public class NmeaReader {
+public class NmeaReader implements IGpxReader {
 
     enum VTG {
@@ -129,5 +132,6 @@
     }
 
-    public GpxData data;
+    private final InputStream source;
+    GpxData data;
 
     private final SimpleDateFormat rmcTimeFmt = new SimpleDateFormat("ddMMyyHHmmss.SSS", Locale.ENGLISH);
@@ -171,7 +175,11 @@
      */
     public NmeaReader(InputStream source) throws IOException {
+        this.source = Objects.requireNonNull(source);
         rmcTimeFmt.setTimeZone(DateUtils.UTC);
         rmcTimeFmtStd.setTimeZone(DateUtils.UTC);
-
+    }
+
+    @Override
+    public boolean parse(boolean tryToFinish) throws SAXException, IOException {
         // create the data tree
         data = new GpxData();
@@ -184,5 +192,5 @@
             if (loopstartChar == -1)
                 //TODO tell user about the problem?
-                return;
+                return false;
             sb.append((char) loopstartChar);
             ps.pDate = "010100"; // TODO date problem
@@ -210,5 +218,7 @@
         } catch (IllegalDataException e) {
             Logging.warn(e);
-        }
+            return false;
+        }
+        return true;
     }
 
@@ -529,3 +539,8 @@
         return new LatLon(lat, lon);
     }
+
+    @Override
+    public GpxData getGpxData() {
+        return data;
+    }
 }
