Converting GPX, KML, GeoJSON, and CSV routes in local worker memory
All route parsing, coordinate rounding, and serialization execute inside everyday.worker.ts without network tile requests or server uploads. Dropping files onto Choose route files or clicking Load sample GPX route keeps sensitive workout logs and survey tracks strictly inside local browser memory.
Supported track, waypoint, and gx:Track parsing rules
XML inputs follow either the TopoGrafix GPX 1.1 Schema documentation or KML 2.2 namespace tags. The GPX parser extracts <trkpt>, <rtept>, and <wpt> attributes with optional <ele> and <time> children, while KML readers handle both <LineString> coordinate strings and <gx:Track> <gx:coord> plus <when> sequences.
Tabular CSV routes map case-insensitive lat/latitude and lon/lng/longitude columns alongside optional ele and time headers. If you also archive field photography alongside trail files, you can inspect embedded camera GPS coordinates in photos in the same local workspace before posting trip reports.
Merging multi-segment activities and rounding coordinates
Checking Merge tracks into one concatenates every track array across dropped files sequentially under the first dataset name. Each exported track retains at least 2 coordinates so short activities never collapse into empty geometries during filtering.
Under Coordinate precision, choosing 5, 6, or 7 decimal places rounds latitude and longitude values cleanly before serialization. Six decimals yields roughly 11 cm resolution for standard GPS logs, whereas 5 decimals trims output size at 1.1 m granularity and 7 decimals preserves 1 cm survey coordinates.
How does the home-zone privacy trimmer protect your address?
Every privacy slider filters coordinates sequentially inside processGeoDatasets before output bytes are generated, discarding sensitive driveway segments while leaving your original file untouched. You can combine cumulative distance trimming along the route path with a circular radius check anchored to the initial start and final end trackpoints.
Distance-based start and end path trimming
Trim start distance and Trim end distance step from 0 to 2000 m in 50 m increments along cumulative Haversine segment lengths. Walking outward from index zero drops consecutive trackpoints until cumulative path distance crosses your chosen start threshold.
Walking backward from the final coordinate applies the symmetric check against total track length. Because trail loops frequently double back along the same street, path-length trimming cleanly removes outbound driveway legs even when an activity crosses near your starting block mid-ride.
Circular radius redaction, waypoints, and timestamp scrubbing
Enabling Home zone radius (0 to 2000 m) measures straight-line Haversine distance from both the first and last recorded points using a 6,371,000 meter Earth radius. Any endpoint segment inside that circle is dropped, and every <wpt> or Point feature is cleared whenever the radius exceeds 0 meters.
Checking Scrub timestamps omits <time> nodes, coordTimes arrays defined in IETF RFC 7946 GeoJSON specification extensions, and CSV time cells to hide daily commute schedules. Downloaded outputs append -redacted instead of -converted when any privacy option is active; tabular CSV logs also pair cleanly with CSV and JSON spreadsheet transformation for downstream reporting.
Output schema differences across GPX 1.1, KML 2.2, and GeoJSON
Switching Output format restructures coordinate tuple order, XML nesting, and timestamp serialization to match each specification. Because RFC 7946 GeoJSON arrays and the OGC KML 2.2 Geography Standard list longitude before latitude, converted arrays invert GPX attribute order automatically.
| Output format | Coordinate order | Geometry container | Elevation & timestamp fields | Primary downstream target |
|---|---|---|---|---|
GPX 1.1 (.gpx) |
lat, lon XML attributes |
<trkseg> and <wpt> |
<ele> (0.1 m) and <time> tags |
GPS watches, OsmAnd, Garmin |
KML 2.2 (.kml) |
lon,lat,ele comma string |
<Placemark> <LineString> |
Altitude third; timestamps omitted | Google Earth desktop imports |
GeoJSON RFC 7946 (.geojson) |
[lon, lat, ele] JSON array |
FeatureCollection LineString |
3rd array element + properties.coordTimes |
Leaflet, Mapbox, QGIS layers |
CSV trackpoints (.csv) |
Separate lat, lon columns |
Flat RFC 4180 table rows | Dedicated ele and time columns |
Excel, pandas, SQLite imports |
When converting exported trail paths into physical craft projects or engraved topographic coasters, you can prepare vector polylines for laser cutters offline using the cleaned geometry data. Exporting GPX, KML, GeoJSON, or CSV from the same sanitized track array guarantees identical coordinate trimming across every file extension.
Tip: Load Load sample GPX route (
sample-morning-loop.gpx,65points) first to watch how dashed red privacy zones move along the Marina Ridge loop as you adjust sliders before importing personal Strava or Garmin exports.
Inspecting offline SVG route previews and elevation gain
Rather than calling external raster tile servers that receive viewport coordinates, the interface draws pure vector graphs locally. Summary cards compute distance (1609.344 meters per mile), kept vs trimmed point counts, and positive elevation gain immediately after each worker pass.
Equirectangular SVG projection without external map tiles
Track coordinates normalize across bounding latitude and longitude spans weighted by cos(midLat) into a centered [6..94, 6..94] coordinate box inside a viewBox="-4 -4 108 108" viewport. Using standard MDN SVG polyline element reference elements renders kept routes in solid blue (#0284c7) and trimmed start or end legs in dashed red (#ef4444).
Drawing non-scaling-stroke SVG geometry keeps preview lines crisp across zoom levels with 0 bytes sent to external mapping vendors. Engineers building physical terrain plaques from spatial coordinates can also inspect exported 3D print meshes in our STL Viewer & Volume Calculator.
Calculating Haversine distance and cumulative elevation
Total distance and elevation statistics recalculate exclusively from kept trackpoints after privacy trimming completes, ensuring redacted driveway legs never inflate final mileage. Positive altitude deltas accumulate into Elevation gain, while negative drops sum into Elevation loss.
The Elevation profile SVG chart (viewBox="0 0 300 80") samples up to 180 points whenever elevation tags exist, displaying minimum and maximum altitude bounds in meters above sea level. Files lacking <ele> or Z-coordinates display a neutral notice instead of fabricating terrain height.