ixnode/php-gpx-reader
Composer 安装命令:
composer require ixnode/php-gpx-reader
包简介
PHP GPX Reader - A versatile library for reading GPX files and efficiently retrieving GPS coordinates based on timestamps.
README 文档
README
PHP GPX Reader - A versatile library for reading GPX files and efficiently retrieving GPS coordinates based on timestamps.
The PHP GPX Reader is a lightweight and powerful tool to find the nearest GPS coordinate from a GPX file based on a specific timestamp. While it's perfect for photo geotagging (e.g., matching photo timestamps to GPS data), the tool can be used in many other scenarios where time-based GPS data needs to be processed.
1. Features
- Reads GPX files and retrieves the closest GPS coordinate to a given timestamp.
- Efficiently handles GPX tracks with multiple points.
- Allows precise time matching to find the nearest location.
- Supports time offset adjustments for scenarios where the reference time is inaccurate.
- Flexible and easy to integrate for different use cases.
2. Usage
use Ixnode\PhpGpxReader\GpxReader; ... $gpxReader = new GpxReader($fileObject); /* Set time gap from camera time: The clock goes ahead. */ $gpxReader->setTimeGapFromString('-00:13:00'); /* Set (real) time to search. */ $gpxReader->setDateTimeFromString('2024-05-05 13:04:16', new DateTimeZone(Timezones::EUROPE_BERLIN)); /* Get the closest coordinate from GPX file. */ $coordinate = $gpxReader->getCoordinate(); /* Time difference to next point. */ print $gpxReader->getTimeDifference(); // (int) 5 /* Latitude to the closest point. */ print $coordinate->getLatitude(); // (float) 47.099262 /* Longitude to the closest point. */ print $coordinate->getLongitude(); // (float) 9.942202 /* Google maps link. */ print $coordinate->getLinkGoogle().PHP_EOL; // (string) https://www.google.de/maps/place/47.099262+9.942202
3. Installation
composer require ixnode/php-gpx-reader
vendor/bin/php-gpx-reader -V
0.1.0 (2024-12-07 19:00:00) - Björn Hempel <bjoern@hempel.li>
4. Command line tool
4.1 Search for the closest point with given taken time
Search for the closest point within a gpx file with given date and camera time gap.
bin/console gpx:read data/gpx/2024-05-05.gpx --date="2024-05-05 13:04:16" --gap="\-00:13:00"
or within your composer project:
vendor/bin/php-gpx-reader gpx:read data/gpx/2024-05-05.gpx --date="2024-05-05 13:04:16" --gap="\-00:13:00"
Time to search: 05.05.2024 10:51:16 UTC
Time difference: 5s
Coordinate: lat=47.099262; lon=9.942202
Coordinate: 47.099262, 9.942202
Google link: https://www.google.de/maps/place/47.099262+9.942202
4.2 Search for the closest point with given image (to read the taken time)
Search for the closest point within a gpx file with given date and camera time gap.
bin/console gpx:read data/gpx/2024-05-05.gpx --image="data/image/example-basic.jpg" --gap="\-00:13:00"
or within your composer project:
vendor/bin/php-gpx-reader gpx:read data/gpx/2024-05-05.gpx --image="data/image/example-basic.jpg" --gap="\-00:13:00"
Time to search: 05.05.2024 10:51:17 UTC
Time difference: 4s
Coordinate: lat=47.099251; lon=9.942342
Coordinate: 47.099251, 9.942342
Google link: https://www.google.de/maps/place/47.099251+9.942342
5. Library development
git clone git@github.com:ixnode/php-gpx-reader.git && cd php-gpx-reader
composer install
composer test
6. License
This library is licensed under the MIT License - see the LICENSE file for details.
ixnode/php-gpx-reader 适用场景与选型建议
ixnode/php-gpx-reader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 12 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「coordinate」 「timestamp」 「gpx」 「camera」 「time-correction」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ixnode/php-gpx-reader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ixnode/php-gpx-reader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ixnode/php-gpx-reader 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Eloquent boolean & timestamp flagged attributes behavior.
Timestamp parameter in public file uri
A library to extend Object capabilities.
Entry GPS Coordinates plugin for Craft CMS
Library for building relative time strings in PHP.
Cs2cs wrapper for PHP
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 36
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-07