定制 inspyrenees/phpgpxparser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

inspyrenees/phpgpxparser

最新稳定版本:1.2.3

Composer 安装命令:

composer require inspyrenees/phpgpxparser

包简介

GPX parsing and analysis toolkit in PHP, with elevation correction using the IGN API.

README 文档

README

Latest Stable Version Packagist downloads PHP Version

A modular GPX parser written in PHP, designed to analyze GPS tracks and enhance elevation data using the IGN (Institut national de l'information géographique et forestière) API.

Features

  • Parse GPX files (tracks, segments, points)
  • Calculate statistics (distance, elevation gain/loss, speed, time)
  • Smooth elevation data with Savitzky-Golay filter
  • Correct elevation using the official IGN elevation API
  • Modular architecture (separate reader, writer, calculators)
  • PSR-4 autoloading (compatible with modern PHP projects)

Installation

composer require inspyrenees/phpgpxparser

Requirements

  • PHP 8.1+
  • Symfony HTTP Client
  • Geotools Library

Basic Usage

use PhpGpxParser\PhpGpxParser;

$phpGpxParser = new PhpGpxParser();
$stats = $phpGpxParser
    ->read($this->gpxFilePath)
    ->smoothElevation() // Optional: apply Savitzky-Golay smoothing
    ->stats();

echo "Total Distance: " . $stats->getTotalDistance() . " m";
echo "Elevation Gain: " . $stats->getElevationGain() . " m";
echo "Average Speed: " . $stats->getAvgSpeed() . " km/h";

You can apply a Savitzky-Golay filter to smooth elevation data and reduce GPS noise using the smoothElevation() method before computing statistics.

🔗 Dependencies

  • Symfony HTTP Client for robust network operations
  • Geotools for precise geographical calculations

License

This project is licensed under the MIT License — see the LICENSE file for details.

统计信息

  • 总下载量: 111
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-12