GPX to WKT Converter
Ingest a fitness-app GPS export into a spatial database for routing, analytics, or comparison against other tracks.
Common issues converting GPX to WKT
- Each track segment becomes a separate LINESTRING line in the output. Multi-segment tracks produce one line per <trkseg>.
- Waypoints become POINT lines; routes become LINESTRINGs.
- Timestamps, elevation, heart rate, and other per-point data are dropped — WKT carries geometry only.
- If you need a single MULTILINESTRING per track, post-process by wrapping the lines in MULTILINESTRING(...) using a one-liner; the converter keeps them flat to maximise downstream flexibility.
Frequently asked questions
How do I bulk-insert into PostGIS?
`INSERT INTO routes (geom) SELECT ST_GeomFromText(line, 4326) FROM stdin;` — the WKT-per-line layout matches what `COPY` expects.
Are altitude values preserved?
If track points have <ele>, the output is LINESTRING Z. Without elevation, plain 2D LINESTRING.
What about multi-track GPX files?
Each <trk> becomes one or more LINESTRINGs (one per <trkseg>). The output is the concatenation; if you need to group, attach a track-id column via a parallel CSV by line index.
Does the converter handle GPX 1.0 and 1.1?
Both. Schema differences are minor for geometry; the relevant <wpt> / <trk> / <rte> elements are the same.