Premium apps Part of RavingDesk
RavingDesk GPS File Converter (GPX ↔ KML ↔ GeoJSON)
Convert GPX, KML and GeoJSON, simplify tracks and get length, climb, descent and duration.
Try an example: GPX track with times and elevations to GeoJSON, with statistics · KML placemarks (point, line, polygon) to GPX · GPX track simplified with Douglas–Peucker (20 m) to KML
How it works
Converts GPS files between GPX 1.1, KML 2.2 and GeoJSON (waypoints, routes, tracks, placemarks, polygons, names, descriptions, elevations and times where the target format has them), optionally simplifies lines with Douglas–Peucker or Visvalingam–Whyatt at a tolerance in metres, and reports for every track the geodesic length on WGS84, elevation range, climb and descent with a noise threshold, duration and average speed. XML is read with a safe parser that refuses entity declarations. It is the GPS engine of RavingDesk’s Data & charts.
- GPX 1.1: waypoints become Points, routes and track segments become LineStrings (several segments: a MultiLineString), with name, description, elevation (third coordinate) and time stamps (properties.times). KML 2.2: Placemarks with Point, LineString, LinearRing, Polygon (with holes), MultiGeometry and gx:Track, plus name, description and ExtendedData. Styles, folders, network links, overlays and 3D models are not converted.
- Writing GPX: points → waypoints, lines → tracks (or routes when the feature came from a GPX route), polygons → closed tracks of their outer rings (GPX has no polygons). Writing KML: one Placemark per feature with name, description and simple properties as ExtendedData; time stamps are not written.
- XML is parsed by a small reader that refuses DOCTYPE definitions and entity declarations (no XXE, no entity expansion), accepts only the five predefined entities and character references, and limits size, element count and depth.
- Track length is the geodesic length on WGS84 (Karney’s algorithm); the 3D length adds the elevation change of every segment. Climb and descent use hysteresis: a change counts only after it exceeds the threshold from the last turning point. Duration is last minus first time stamp; the average speed includes stops.
- Douglas–Peucker keeps every vertex farther than the tolerance from the simplified line; Visvalingam–Whyatt removes the vertex with the smallest triangle area until all are above the tolerance. Both measure in a local equirectangular projection (metres) around each line.
Sources
- GPX 1.1 Schema Documentation (TopoGrafix)
- OGC KML 2.2 (OGC 07-147r2) (Open Geospatial Consortium)
- RFC 7946: The GeoJSON Format (IETF, 2016)
- Algorithms for the reduction of the number of points required to represent a digitized line or its caricature (D. H. Douglas and T. K. Peucker, Cartographica 10(2), 1973)
- Line generalisation by repeated elimination of points (M. Visvalingam and J. D. Whyatt, The Cartographic Journal 30(1), 1993)
- Algorithms for geodesics (J. Geodesy 87, 43–55) (C. F. F. Karney, 2013)
Part of RavingDesk
-
RavingDesk Paper trading & data workspace
Practise trading on paper and chart your data: orders, risk, datasets, analyses, reports.
Related tools
- RavingDesk GeoJSON Validator & Inspector – Validate and repair GeoJSON (RFC 7946) and measure areas and lengths on WGS84.
- RavingDesk Geodesic Distance & Bearing Calculator – Exact distance, bearings and midpoint between coordinates or along a route on WGS84.
- Running Pace & Splits – Pace, time or distance in km or miles, splits, race predictions, treadmill speed, laps.
How to use the RavingDesk GPS File Converter (GPX ↔ KML ↔ GeoJSON)
Convert GPS tracks between GPX, KML and GeoJSON, simplify them, and read length, climb, descent and duration from the file.
What it is for
GPS devices and sports apps export GPX, Google Earth uses KML, and web maps and GIS tools prefer GeoJSON. Moving a track between them often loses names or elevations, or produces files with tens of thousands of points that slow everything down.
This converter reads a GPX 1.1, KML 2.2 or GeoJSON file, upload or paste, and writes it in the format you choose. It keeps waypoints, routes, tracks, placemarks, polygons, names, descriptions, elevations and time stamps wherever the target format can hold them. It can thin out lines with Douglas–Peucker or Visvalingam–Whyatt, and it reports for every track the length on the WGS84 ellipsoid, the elevation range, climb and descent, the duration and the average speed.
It does not convert styles, folders, network links, image overlays or 3D models, and KMZ files must be unzipped first. XML is read by a safe parser that refuses entity declarations, so a hostile file cannot make it read other files or explode in size.
Worked example
The built-in example is a 10-point GPX track around Berlin's Tiergarten with elevations and times. Converting it to GeoJSON with the default 2 m elevation threshold gives:
| Result | Value |
|---|---|
| Features | 1 Point, 1 LineString |
| Track length | 4.269 km |
| Climb / descent | 4.0 / 4.0 m |
| Elevation range | 34 – 38 m |
| Duration | 0:39:00 |
| Average speed | 6.57 km/h |
With the threshold set to 0 m, the same track reports 6.0 m of climb and 6.0 m of descent. Small ups and downs of 1–1.5 m are then counted too. Simplifying with Douglas–Peucker at 100 m keeps 7 of the 10 points; the track becomes 4.237 km and the duration stays 0:39:00, because the time stamps are thinned together with their points.
Converting to KML keeps the name, elevations and geometry, but shows the warning "Point times are not written to KML", because plain KML lines have no time stamps. Converting a KML polygon to GPX writes it as a closed track, because GPX has no polygons.
How to read the result
- Converted shows source and target format. Features counts the geometries found.
- The Tracks and lines table has one row per line: points, geodesic length, climb, descent, elevation range, duration and average speed. Values that the file lacks show a dash.
- Points after simplification shows how much the simplification removed.
- The download button gives the converted file. Warnings list everything that could not be carried over.
Tips and common mistakes
- GPS elevations are noisy. A threshold of 2–5 m gives more realistic climb figures than 0 m.
- Douglas–Peucker's tolerance is a distance in metres (the largest allowed deviation). Visvalingam's is an area in m². Start with 5–20 m for walking tracks.
- The average speed includes stops, so it is lower than your moving speed.
- To edit or measure the points in a table, import the GPX, KML or GeoJSON file into RavingDesk's Data & charts. Each point becomes a row ready for the Geo layer.
FAQ
Is the track length the same as on my watch?
Close, but watches often smooth tracks or use other filters. This tool measures exactly the points in the file on the WGS84 ellipsoid, without heights.
Why did my KML lose its colours?
Styles are not converted. Only geometry, names, descriptions and simple properties are kept.
Can it read gx:Track from Google Earth?
Yes. gx:Track and gx:MultiTrack become lines, and their time stamps are kept in GeoJSON.
Is my file uploaded somewhere permanently?
No. The converted file is a temporary download that expires after about two hours.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ravingdeskgpsfileconverter.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ravingdeskgpsfileconverter.usefulweb.site/mcp· tool nameravingdesk_gps_file_converter
Example request
curl -s -X POST https://ravingdeskgpsfileconverter.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'