1.0.0本地计算

轨迹查看:读懂自己的 GPX 与 GeoJSON

在浏览器本地查看轨迹的点数、起终点、距离和已有高程,不上传文件。高程缺失时明确显示未知,不用零填平。

选择本地轨迹文件

仅支持 GPX / GeoJSON;最大 20 MB、200,000 个坐标点。文件不会上传。

文件只在当前页面内读取,刷新后不会保留。请避免在公共设备上打开含家庭住址等敏感位置的文件。

公式与适用条件

工具做什么

轨迹查看器读取你选择的 GPX 或 GeoJSON 文件,在本地完成解析和统计,显示:

  • 坐标点数量。
  • 按顺序连接各点后的 WGS84 测地距离。
  • 起点与终点的经纬度。
  • 如果文件包含高程,显示累计爬升;否则明确标记为未知。

它不评价你的配速,不把轨迹与赛事官方路线比对,也不声称轨迹经过权威核验。

支持的文件

  • GPX 1.1:优先读取轨迹点(trkpt);没有 trkseg 时读取路线点(rtept)。多个线段分别测量,不把线段端点连接。
  • GeoJSON:读取 LineString 坐标。坐标顺序为经度、纬度,可带高程。

其他几何类型(例如散点、多边形)不会自动当作一条跑道。文件上限为 20 MB、200,000 个坐标点;工具会在提示中说明无法解析的部分,而不是悄悄丢弃。

距离与高程口径

距离使用 WGS84 椭球上的测地线距离,逐点相加。它不同于平面勾股计算,也不做平滑、抽稀或纠偏。GPS 噪声、隧道和信号丢失都会影响结果,因此距离是信息性统计,不是赛事丈量。

累计爬升等于相邻高程正差之和。如果文件完全没有高程字段,累计爬升为未知,不能写成 0——0 会被误读为「全程平地」。如果只有部分点有高程,工具会给出提示并说明计算覆盖情况。

隐私

文件只在你的浏览器内读取,不会上传到本站服务器,也不会写入服务器日志。页面刷新后,文件内容不会被保留。请不要在公共电脑上打开包含家庭住址等敏感位置的文件;如需分享轨迹,先删除起点附近的私人位置和时间信息。

能回答与不能回答的问题

它能回答:文件有多少点、首尾在哪里、连起来大约多长、有高程时累计爬升是多少。

它不能回答:这条路线的官方认证距离、比赛日是否开放、路面是否安全、你的配速是否合理。GPX 只是一串坐标,不包含赛事规则、通行许可或实时路况。

需要把轨迹拆成分段配速,可以配合分段配速表;需要理解自己的训练负荷,应结合训练记录与恢复情况,而不是只看一条轨迹。

验证算例

  • 赤道上经度 0 到 0.02 度、无高程的三点轨迹:距离约 2226.3898 米,取整 2226 米;点数为 3;累计爬升为未知。
  • 赤道上经度 0 到 0.002 度、高程为 10、20、15 米的三点轨迹:距离约 222.639 米,取整 223 米;正爬升为 10 米。

算例由独立 WGS84 算术核对。

来源与适用范围

文件格式依据 GPX 1.1 规范与 RFC 7946。本文与工具核验日期为 2026-10-27。

实现规范(英文原文)

以下字段用于实现与审阅核对,正文提供中文解释。

公式与适用条件
Parse GPX track points or GeoJSON LineString coordinates in order. Distance is the sum of WGS84 geodesic inverse distances between consecutive points. Elevation gain is the sum of positive differences between consecutive elevation values when present; otherwise it is reported as unknown.
适用条件
  • Coordinates are WGS84 latitude/longitude.
  • GPX tracks and routes and GeoJSON LineStrings are supported; distances within each segment are summed and endpoints of separate segments are not joined.
  • The file is read locally in the browser and is not uploaded to a server.
  • GPS noise and gaps are not corrected; distances are informational, not a certified measurement.
  • Input files are limited to 20 MB and 200,000 coordinate points; larger files are rejected before processing.
舍入规则
Distance and elevation gain to the nearest whole metre.

独立算例

期望值由独立算术或已核验算法得出,不由页面脚本生成。

case-track-view-elevation独立算例

Independent arithmetic: 0.002 degrees along the equator is about 222.639 m, rounded to 223 m. Positive elevation changes are +10 m and +0 m after the descent, so gain is 10 m.

输入
{
  "format": "geojson",
  "coordinates": [
    [
      0,
      0,
      10
    ],
    [
      0.001,
      0,
      20
    ],
    [
      0.002,
      0,
      15
    ]
  ]
}
期望
{
  "distanceMeters": 223,
  "pointCount": 3,
  "start": {
    "longitude": 0,
    "latitude": 0
  },
  "end": {
    "longitude": 0.002,
    "latitude": 0
  },
  "elevationGainMeters": 10
}
case-track-view-equator独立算例

Independent WGS84 arithmetic on the equator: each 0.01 degree of longitude is about 1113.1949 m, so 0.02 degrees is about 2226.3898 m, rounded to 2226 m. No elevations are present, so gain stays null.

输入
{
  "format": "geojson",
  "coordinates": [
    [
      0,
      0
    ],
    [
      0.01,
      0
    ],
    [
      0.02,
      0
    ]
  ]
}
期望
{
  "distanceMeters": 2226,
  "pointCount": 3,
  "start": {
    "longitude": 0,
    "latitude": 0
  },
  "end": {
    "longitude": 0.02,
    "latitude": 0
  },
  "elevationGainMeters": null
}

来源与证据

GPS Exchange Format (GPX) 1.1

GPX is an XML schema for exchanging GPS data. GPX 1.1 defines track, route and waypoint structures with latitude, longitude and optional elevation.

TopoGrafix · 查阅 2026年10月26日

RFC 7946: The GeoJSON Format

GeoJSON defines JSON-based geospatial objects including LineString coordinates. GeoJSON coordinates use longitude, latitude order and positions may include elevation.

Internet Engineering Task Force · 查阅 2026年10月26日

版本与审阅

撰写: RunMap editorial desk (AI-assisted draft and review)

更新于: 2026年10月28日

审阅于: 2026年10月28日 · 1 条审阅记录

返回全部工具