TrailCam

Guides

GPX vs Shapefile for trail data: which one fits a hike?

A GPX file and a shapefile can both end up showing the same line on a map, but they come from different worlds. GPX was built specifically for GPS tracks — one file, one format, made to carry a timestamped trail. A shapefile is a general-purpose GIS format for any kind of geographic feature, stored across several files at once, with no built-in idea of time passing along a line at all. For a single hike, that difference decides which one actually fits.

What each format is built to hold

GPX is one file, made for tracks

A GPX file is plain-text XML built specifically for GPS data, with a track made of an ordered list of points, each one usually carrying a latitude, a longitude, an elevation and a timestamp. That structure exists because GPX was designed for exactly this job: recording where something moved, and when.

A shapefile is several files, made for GIS features of any kind

A shapefile is not a single file at all — the format, introduced by Esri, needs at minimum a .shp file for the geometry, a .shx index file, and a .dbf attribute table, usually travelling together with a .prj file that defines the coordinate system. It was built to hold any kind of geographic feature a GIS system might work with — points, lines or polygons for things like property boundaries, roads or land cover — not specifically a GPS trail. One shapefile can only hold one geometry type at a time, so a hike's route and any waypoints along it need two separate shapefiles rather than one file that carries both, the way a single GPX file does.

Why that matters for a hike

The part of a hike a shapefile struggles with is time. A GPX track gives every point its own timestamp, which is what lets pace and moving time get calculated afterward. A shapefile's line geometry is usually one feature with one row in its attribute table, so a route saved as a line shapefile normally ends up with a single record for the whole hike rather than a timestamp at every point along it — the per-point timing that made those calculations possible is what gets left behind in that conversion.

Elevation fares a little better. A shapefile can carry a height value at every vertex, using a Z-enabled geometry type — a PointZ or a PolylineZ rather than the plain 2D version — so a converted route can still hold its elevation profile if the tool doing the conversion writes it that way. Whether it actually does depends on the software; not every GPX-to-shapefile conversion turns that option on by default.

Side by side

  • Structure: GPX is one file describing a timestamped track. A shapefile is a bundle of files describing geometry and attributes, with no particular tie to GPS or to time.
  • Origin: GPX is an open, vendor-neutral format published in 2002, aimed at GPS devices and software. The shapefile format was introduced by Esri in the early 1990s for general-purpose GIS work.
  • Compatibility: GPX opens in nearly any GPS, hiking or mapping app. A shapefile is the working format for GIS software such as QGIS or ArcGIS, and is read more narrowly outside that world.
  • Best fit: GPX for a recorded hike that needs its timing kept. Shapefile for bringing that same route into GIS analysis alongside other geographic layers.
  • Readability: GPX is plain text, openable in any editor. A shapefile's .dbf and .shp files need dedicated GIS or spatial software to make sense of.

Converting between them

Going from GPX to shapefile is a routine job for GIS software. QGIS, for one, reads a GPX file directly as a set of layers — tracks, waypoints and routes each come in separately — and any of those layers can be exported as a shapefile in a few clicks, with the option to write elevation into a Z-enabled geometry type if the route needs to keep its climb.

Going the other way, from a shapefile back to GPX, works the same way in reverse through GIS software, but it only makes sense to begin with if the shapefile actually holds a line or point layer that came from a real track — a shapefile built for polygons, like a park boundary or a land parcel, has no route to hand back at all.

What TrailCam exports

TrailCam exports a recorded hike as GPX 1.1 or as a CSV summary, not as a shapefile — GPX is what matches a walk that happened once, in order, over time, which is exactly the shape a shapefile has to work to recreate after the fact. If a route needs to sit alongside other layers in a GIS project, that GPX file is the starting point GIS software like QGIS can convert from directly. Export is part of the optional TrailCam Pro upgrade; the app itself is free to download.

Questions

Does a shapefile keep the timestamp for every point on a hike?
Usually not, if the route is saved as a line shapefile — a line feature typically carries one attribute row for the whole track, not a timestamp per point. Keeping per-point time means exporting the route as a point shapefile instead, with one row for each recorded position.
Can a shapefile store the elevation from a hike?
Yes, using a Z-enabled geometry type such as PolylineZ, which carries a height value at every vertex. It depends on the conversion tool writing the file that way, since a plain 2D shapefile drops elevation entirely.
Does TrailCam export directly to shapefile?
No. TrailCam exports GPX 1.1 or a CSV summary. A shapefile is created afterward, if needed, by opening that GPX file in GIS software such as QGIS and exporting the track or waypoint layer from there.

Recording your own routes

TrailCam is an iPhone app that records your route with GPS, keeps video clips, photos and voice notes pinned to the spot where you took them, and exports the result as GPX 1.1 or CSV. It is free to download.

Download on the App Store