{"id":29420012,"url":"https://github.com/allebb/distical","last_synced_at":"2025-07-12T01:15:18.846Z","repository":{"id":7403889,"uuid":"8734409","full_name":"allebb/distical","owner":"allebb","description":"A PHP library for calculating distance between two or more latitude/longitude coordinates.","archived":false,"fork":false,"pushed_at":"2023-11-08T14:05:19.000Z","size":109,"stargazers_count":40,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-18T14:55:50.257Z","etag":null,"topics":["calculator","distance","lat","latitude","lng","longitude","miles","nautical","php"],"latest_commit_sha":null,"homepage":"","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/allebb.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-03-12T17:55:50.000Z","updated_at":"2025-04-30T11:03:12.000Z","dependencies_parsed_at":"2024-06-18T20:13:10.969Z","dependency_job_id":"71cc2fa9-f773-40c8-9593-bd021657cc34","html_url":"https://github.com/allebb/distical","commit_stats":{"total_commits":92,"total_committers":5,"mean_commits":18.4,"dds":0.3152173913043478,"last_synced_commit":"480142af8abf9549ecd2bd5387d3fb753ca0bbcd"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/allebb/distical","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fdistical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fdistical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fdistical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fdistical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/allebb","download_url":"https://codeload.github.com/allebb/distical/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/allebb%2Fdistical/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264922929,"owners_count":23683707,"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","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":["calculator","distance","lat","latitude","lng","longitude","miles","nautical","php"],"created_at":"2025-07-12T01:15:18.030Z","updated_at":"2025-07-12T01:15:18.789Z","avatar_url":"https://github.com/allebb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distical\n\n[![Build](https://github.com/allebb/distical/workflows/build/badge.svg)](https://github.com/allebb/distical/actions)\n[![Code Coverage](https://codecov.io/gh/allebb/distical/branch/master/graph/badge.svg)](https://codecov.io/gh/allebb/distical)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/allebb/distical/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/allebb/distical/?branch=master)\n[![Code Climate](https://codeclimate.com/github/allebb/distical/badges/gpa.svg)](https://codeclimate.com/github/allebb/distical)\n[![Latest Stable Version](https://poser.pugx.org/ballen/distical/v/stable)](https://packagist.org/packages/ballen/distical) [![Latest Unstable Version](https://poser.pugx.org/ballen/distical/v/unstable)](https://packagist.org/packages/ballen/distical) [![License](https://poser.pugx.org/ballen/distical/license)](https://packagist.org/packages/ballen/distical)\n\nDistical is a PHP distance calculator library of which, amongst other things is developed to calculate the distance between two or more lat/long coordinates.\n\n## License\n\nThis client library is released under the [MIT license](LICENSE).\n\n## Requirements\n\nThis library is unit tested against PHP 7.3, 7.4, 8.0, 8.1 and 8.2!\n\nIf you need to use an older version of PHP, you should instead install the 3.x version of this library (see below for details).\n\n## Setup\n\nI highly recommend the use of [Composer](https://getcomposer.org/) when installing and using this library, it is not mandatory however and you can use a provided 'include' script to load in this library if required.\n\n### Composer\n\nSimply require this package as follows:\n\n```shell\ncomposer require ballen/distical\n```\n\n**If you need to use an older version of PHP, version 2.x.x supports PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1 and 7.2, you can install this version using Composer with this command instead:**\n\n```shell\ncomposer require ballen/disitcal ^2.0\n```\n\n```\ncomposer install\n```\n\n### Standalone\n\nYou can use the library \"standalone\" by downloading it from the [GitHub releases section](https://github.com/allebb/distical/releases), extracting the files to a place on your server and then adding the \"include\" into your code like so:\n\n```php\nrequire_once 'path/to/Distical/Distical.inc.php';\n```\n\n## Examples\n\n```php\n\nuse Ballen\\Distical\\Calculator as DistanceCalculator;\nuse Ballen\\Distical\\Entities\\LatLong;\n\n// Set our Lat/Long coordinates\n$ipswich = new LatLong(52.057941, 1.147172);\n$london = new LatLong(51.507608, -0.127822);\n\n// Get the distance between these two Lat/Long coordinates...\n$distanceCalculator = new DistanceCalculator($ipswich, $london);\n\n// You can then compute the distance...\n$distance = $distanceCalculator-\u003eget();\n// you can also chain these methods together eg. $distanceCalculator-\u003eget()-\u003easMiles();\n\n// We can now output the miles using the asMiles() method, you can also calculate and use asKilometres() or asNauticalMiles() as required!\necho 'Distance in miles between Central Ipswich and Central London is: ' . $distance-\u003easMiles();\n```\n\nA set of working examples including multi-point calculations can be found in the ``/examples`` directory, feel free to browse or run them!\n\n## Tests and coverage\n\nThis library is fully unit tested using [PHPUnit](https://phpunit.de/).\n\nI use GitHub Actions for continuous integration, which triggers tests for PHP 7.3, 7.4, 8.0, 8.1 and 8.2 everytime a commit is pushed.\n\nIf you wish to run the tests yourself you should run the following:\n\n```\n# Install the Distical Library with the 'development' packages this then including PHPUnit!\ncomposer install\n\n# Now we run the unit tests (from the root of the project) like so:\n./vendor/bin/phpunit\n```\n\nCode coverage can also be ran but requires XDebug installed...\n```\n./vendor/bin/phpunit --coverage-html ./report\n```\n\n## Support\n\nI am happy to provide support via. my personal email address, so if you need a hand drop me an email at: [ballen@bobbyallen.me](mailto:ballen@bobbyallen.me).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallebb%2Fdistical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallebb%2Fdistical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallebb%2Fdistical/lists"}