{"id":22820274,"url":"https://github.com/ixnode/php-gpx-reader","last_synced_at":"2026-02-09T21:10:32.359Z","repository":{"id":267024192,"uuid":"900053858","full_name":"ixnode/php-gpx-reader","owner":"ixnode","description":"A versatile library for reading GPX files and efficiently retrieving GPS coordinates based on timestamps.","archived":false,"fork":false,"pushed_at":"2024-12-07T23:37:26.000Z","size":188,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T22:18:09.205Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ixnode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-07T18:28:53.000Z","updated_at":"2024-12-07T23:37:26.000Z","dependencies_parsed_at":"2024-12-07T19:27:57.413Z","dependency_job_id":"9bcd4881-4588-4ac4-9f8b-9c214c6f8484","html_url":"https://github.com/ixnode/php-gpx-reader","commit_stats":null,"previous_names":["ixnode/php-gpx-reader"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ixnode/php-gpx-reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-gpx-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-gpx-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-gpx-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-gpx-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixnode","download_url":"https://codeload.github.com/ixnode/php-gpx-reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixnode%2Fphp-gpx-reader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271747023,"owners_count":24813604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T15:17:42.191Z","updated_at":"2026-02-09T21:10:32.302Z","avatar_url":"https://github.com/ixnode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP GPX Reader\n\n[![Release](https://img.shields.io/github/v/release/ixnode/php-gpx-reader)](https://github.com/ixnode/php-gpx-reader/releases)\n[![](https://img.shields.io/github/release-date/ixnode/php-gpx-reader)](https://github.com/ixnode/php-gpx-reader/releases)\n![](https://img.shields.io/github/repo-size/ixnode/php-gpx-reader.svg)\n[![PHP](https://img.shields.io/badge/PHP-^8.2-777bb3.svg?logo=php\u0026logoColor=white\u0026labelColor=555555\u0026style=flat)](https://www.php.net/supported-versions.php)\n[![PHPStan](https://img.shields.io/badge/PHPStan-Level%20Max-777bb3.svg?style=flat)](https://phpstan.org/user-guide/rule-levels)\n[![PHPUnit](https://img.shields.io/badge/PHPUnit-Unit%20Tests-6b9bd2.svg?style=flat)](https://phpunit.de)\n[![PHPCS](https://img.shields.io/badge/PHPCS-PSR12-416d4e.svg?style=flat)](https://www.php-fig.org/psr/psr-12/)\n[![PHPMD](https://img.shields.io/badge/PHPMD-ALL-364a83.svg?style=flat)](https://github.com/phpmd/phpmd)\n[![Rector - Instant Upgrades and Automated Refactoring](https://img.shields.io/badge/Rector-PHP%208.2-73a165.svg?style=flat)](https://github.com/rectorphp/rector)\n[![LICENSE](https://img.shields.io/github/license/ixnode/php-api-version-bundle)](https://github.com/ixnode/php-api-version-bundle/blob/master/LICENSE)\n\n\u003e PHP GPX Reader - A versatile library for reading GPX files and efficiently retrieving GPS coordinates based on timestamps.\n\nThe PHP GPX Reader is a lightweight and powerful tool to find the nearest GPS coordinate from a GPX file based on a\nspecific timestamp. While it's perfect for photo geotagging (e.g., matching photo timestamps to GPS data), the tool\ncan be used in many other scenarios where time-based GPS data needs to be processed.\n\n## 1. Features\n\n* Reads GPX files and retrieves the closest GPS coordinate to a given timestamp.\n* Efficiently handles GPX tracks with multiple points.\n* Allows precise time matching to find the nearest location.\n* Supports time offset adjustments for scenarios where the reference time is inaccurate.\n* Flexible and easy to integrate for different use cases.\n\n## 2. Usage\n\n```php\nuse Ixnode\\PhpGpxReader\\GpxReader;\n\n...\n\n\n$gpxReader = new GpxReader($fileObject);\n\n/* Set time gap from camera time: The clock goes ahead. */\n$gpxReader-\u003esetTimeGapFromString('-00:13:00');\n\n/* Set (real) time to search. */\n$gpxReader-\u003esetDateTimeFromString('2024-05-05 13:04:16', new DateTimeZone(Timezones::EUROPE_BERLIN));\n\n/* Get the closest coordinate from GPX file. */\n$coordinate = $gpxReader-\u003egetCoordinate();\n\n/* Time difference to next point. */\nprint $gpxReader-\u003egetTimeDifference();\n// (int) 5\n\n/* Latitude to the closest point. */\nprint $coordinate-\u003egetLatitude();\n// (float) 47.099262\n\n/* Longitude to the closest point. */\nprint $coordinate-\u003egetLongitude();\n// (float) 9.942202\n\n/* Google maps link. */\nprint $coordinate-\u003egetLinkGoogle().PHP_EOL;\n// (string) https://www.google.de/maps/place/47.099262+9.942202\n\n```\n\n## 3. Installation\n\n```bash\ncomposer require ixnode/php-gpx-reader\n```\n\n```bash\nvendor/bin/php-gpx-reader -V\n```\n\n```bash\n0.1.0 (2024-12-07 19:00:00) - Björn Hempel \u003cbjoern@hempel.li\u003e\n```\n\n## 4. Command line tool\n\n### 4.1 Search for the closest point with given taken time\n\n\u003e Search for the closest point within a gpx file with given date and camera time gap.\n\n```bash\nbin/console gpx:read data/gpx/2024-05-05.gpx --date=\"2024-05-05 13:04:16\" --gap=\"\\-00:13:00\"\n```\n\nor within your composer project:\n\n```bash\nvendor/bin/php-gpx-reader gpx:read data/gpx/2024-05-05.gpx --date=\"2024-05-05 13:04:16\" --gap=\"\\-00:13:00\"\n```\n\n```bash\n\nTime to search:   05.05.2024 10:51:16 UTC\nTime difference:  5s\nCoordinate:       lat=47.099262; lon=9.942202\nCoordinate:       47.099262, 9.942202\nGoogle link:      https://www.google.de/maps/place/47.099262+9.942202\n\n```\n\n### 4.2 Search for the closest point with given image (to read the taken time)\n\n\u003e Search for the closest point within a gpx file with given date and camera time gap.\n\n```bash\nbin/console gpx:read data/gpx/2024-05-05.gpx --image=\"data/image/example-basic.jpg\" --gap=\"\\-00:13:00\"\n```\n\nor within your composer project:\n\n```bash\nvendor/bin/php-gpx-reader gpx:read data/gpx/2024-05-05.gpx --image=\"data/image/example-basic.jpg\" --gap=\"\\-00:13:00\"\n```\n\n```bash\n\nTime to search:   05.05.2024 10:51:17 UTC\nTime difference:  4s\nCoordinate:       lat=47.099251; lon=9.942342\nCoordinate:       47.099251, 9.942342\nGoogle link:      https://www.google.de/maps/place/47.099251+9.942342\n\n```\n\n## 5. Library development\n\n```bash\ngit clone git@github.com:ixnode/php-gpx-reader.git \u0026\u0026 cd php-gpx-reader\n```\n\n```bash\ncomposer install\n```\n\n```bash\ncomposer test\n```\n\n## 6. License\n\nThis library is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-gpx-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixnode%2Fphp-gpx-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixnode%2Fphp-gpx-reader/lists"}