Converting GPS Tracks (GPX, KML, NMEA, GeoJSON) for GIS & Google Earth
Geographic data suffers from one of the most persistent compatibility headaches in software engineering: every device family speaks a different spatial dialect. Handheld GPS watches and Strava export GPX 1.1; Google Earth and My Maps expect KML/KMZ; web maps (Mapbox, Leaflet) consume GeoJSON; and raw u-blox serial receivers and dashcams stream NMEA 0183 ASCII sentences. Worse, half of them order coordinates as [Latitude, Longitude] while the other half mandate [Longitude, Latitude].
1. Mastering the Coordinate Order Trap
Mixing up latitude and longitude drops a hike in the Atlas Mountains straight into the Indian Ocean. Keep this rule handy:
- GPX & Google Maps UI: Latitude first, Longitude second (
lat="34.03" lon="-5.00"). - KML 2.2 & GeoJSON (RFC 7946): Longitude first, Latitude second (
-5.00,34.03,410or[-5.00, 34.03]). - NMEA 0183 ($GPGGA / $GPRMC): Packed Degrees + Decimal Minutes (
3401.8000,N=34 + 1.8/60 = 34.03°).
2. Complete Field-to-Map Conversion Pipelines
- Dashcam / Drone Serial Logs to Google Earth: Start in our NMEA to GPX / CSV Decoder to convert
DDMM.MMMMsentences into decimal WGS84 GPX tracks, automatically skipping cold-start invalid fixes. - Garmin / Strava Trails to Excel & 3D Earth: Use our GPX to KML / Excel / GeoJSON Converter to flip coordinates cleanly for Google Earth or compute Haversine distance and elevation gain in Excel.
- Google My Maps & KMZ Archives to GPS Watches: Drop compressed
.kmzfiles directly into our KML / KMZ Converter—JSZip unpacksdoc.kmlautomatically in RAM. - PostGIS / Mapbox Boundaries to Field Spreadsheets: Flatten RFC 7946 FeatureCollections via our GeoJSON to CSV / KML Converter.
Because all four GIS tools run offline in browser memory, surveyors and logistics teams can process confidential site coordinates and fleet routes directly in the field without uploading sensitive location histories to third-party servers.
3. Deep Dive: WGS84 Datum, Altitude Geoid Separation & Precision
All four consumer spatial formats—GPX, KML, GeoJSON, and NMEA 0183—standardize on the WGS84 (EPSG:4326) geographic coordinate system. However, subtle vertical and precision quirks frequently confuse newcomers:
- Decimal Place Accuracy: Four decimal places (
34.0209) pinpoints a location within ~11 meters; five decimal places (34.02091) resolves ~1.1 meters (ideal for hiking and road routing); six decimal places resolves ~11 centimeters (survey-grade RTK GNSS). Never let Excel auto-round GPS columns to 2 decimal places. - Ellipsoidal vs. Mean Sea Level Altitude: NMEA
$GPGGAreports orthometric altitude above Mean Sea Level (MSL) alongside geoid separation, while smartphone GPS chips sometimes log raw WGS84 ellipsoidal height—creating a 30–50 meter vertical offset when comparing watch tracks against Google Earth terrain. - Projected Coordinates (EPSG:3857): Web Mercator GeoJSON files exported from corporate GIS servers occasionally store meter offsets (e.g.,
-762518, 4031592) instead of WGS84 degrees. Always reproject to EPSG:4326 before generating KML or GPX tracks.
4. Real-World Case Study: Auditing Fleet Delivery Routes from Dashcam NMEA Logs
Logistics operators running commercial dashcams (Viofo, Nextbase, BlackVue) or Arduino/ESP32 vehicle trackers often receive raw .nmea text logs filled with $GPGGA, $GPRMC, and $GPGSV telemetry lines. Dropping a month of daily logs into our NMEA Decoder in Batch ZIP mode strips invalid cold-start fixes, converts DDMM.MMMM coordinates to clean decimal degrees, and outputs Excel-ready CSV mileage tables plus Google Earth .gpx/.kml playback tracks—without exposing sensitive customer delivery addresses to any cloud mapping service.
5. Command-Line Companion Reference (GDAL & GPSBabel)
# Batch convert a folder of GPX tracks to GeoJSON using GDAL ogr2ogr:
for f in *.gpx; do ogr2ogr -f GeoJSON "${f%.gpx}.geojson" "$f" tracks; done
# Convert raw NMEA log directly to Google Earth KML via GPSBabel:
gpsbabel -i nmea -f dashcam.nmea -o kml -F route.kml
Whether you are mapping a mountain marathon, auditing commercial delivery mileage, or preparing Shapefile attributes alongside our DBF to Excel Converter, keeping spatial translation local guarantees instant speed and total location privacy.
6. Choosing the Right Spatial Format for Your Project
Selecting the optimal GIS interchange format saves hours of downstream conversion work across teams. Use GPX 1.1 whenever files must load directly onto outdoor hardware (Garmin Fenix/Edge, Suunto, Wahoo, Coros, OsmAnd) because handheld firmware expects <trkpt> and <wpt> XML schemas. Choose KML / KMZ for executive presentations, real-estate site walks, and 3D terrain flythroughs inside Google Earth Pro, where custom pin icons, polygon fill opacity, and camera tilt angles shine.
Choose RFC 7946 GeoJSON for every web or mobile engineering project—Mapbox GL JS, Leaflet, Turf.js, PostGIS, and Kepler.gl parse GeoJSON natively without XML overhead. Finally, export to Excel / CSV whenever non-GIS stakeholders need to filter delivery stops, calculate Haversine mileage reimbursements, or join GPS coordinates with warehouse inventory tables. Keep our four offline spatial tools bookmarked—GPX, KML/KMZ, GeoJSON, and NMEA—so you can bridge any GPS receiver, dashcam, or web map in seconds even without cellular coverage in the field.