{"id":16233356,"url":"https://github.com/jeroendesloovere/geolocation-php-api","last_synced_at":"2025-04-06T05:18:27.128Z","repository":{"id":10974977,"uuid":"13291990","full_name":"jeroendesloovere/geolocation-php-api","owner":"jeroendesloovere","description":"This Geolocation PHP class connects to Google Geocoding API to find latitude/longitude or the address.","archived":false,"fork":false,"pushed_at":"2023-07-16T04:55:54.000Z","size":56,"stargazers_count":73,"open_issues_count":0,"forks_count":35,"subscribers_count":9,"default_branch":"master","last_synced_at":"2023-12-19T17:07:42.834Z","etag":null,"topics":["geocoding","geolocation","latitude","longitude","php","php7"],"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/jeroendesloovere.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}},"created_at":"2013-10-03T06:30:23.000Z","updated_at":"2023-10-13T02:12:01.000Z","dependencies_parsed_at":"2022-09-01T20:51:09.395Z","dependency_job_id":"96530b50-15ac-4d8f-bc0f-dfd3130955a6","html_url":"https://github.com/jeroendesloovere/geolocation-php-api","commit_stats":{"total_commits":78,"total_committers":8,"mean_commits":9.75,"dds":0.5256410256410257,"last_synced_commit":"019e6e84226e6c38e98694f037fccd7254a99ad2"},"previous_names":[],"tags_count":12,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroendesloovere%2Fgeolocation-php-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroendesloovere%2Fgeolocation-php-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroendesloovere%2Fgeolocation-php-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeroendesloovere%2Fgeolocation-php-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeroendesloovere","download_url":"https://codeload.github.com/jeroendesloovere/geolocation-php-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436630,"owners_count":20938602,"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":["geocoding","geolocation","latitude","longitude","php","php7"],"created_at":"2024-10-10T13:12:24.316Z","updated_at":"2025-04-06T05:18:26.866Z","avatar_url":"https://github.com/jeroendesloovere.png","language":"PHP","readme":"# Geolocation PHP class connects to Google MAPS API\n[![Latest Stable Version](http://img.shields.io/packagist/v/jeroendesloovere/geolocation-php-api.svg)](https://packagist.org/packages/jeroendesloovere/geolocation-php-api)\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/jeroendesloovere/geolocation-php-api/blob/master/LICENSE)\n[![Build Status](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jeroendesloovere/geolocation-php-api/?branch=master)\n\n\u003e This Geolocation PHP class connects to Google Maps API to find latitude/longitude or address.\n\n## Installing\n\n### Using Composer\n\nWhen using [Composer](https://getcomposer.org) you can always load in the latest version.\n\n``` json\ncomposer require jeroendesloovere/geolocation-php-api\n```\nCheck [in Packagist](https://packagist.org/packages/jeroendesloovere/geolocation-php-api).\n\n### Usage example\n\n**getCoordinates**\n\n\u003e Get latitude/longitude coordinates from address.\n\n``` php\n$street = 'Koningin Maria Hendrikaplein';\n$streetNumber = '1';\n$city = 'Gent';\n$zip = '1';\n$country = 'belgium';\n\n$result = Geolocation::getCoordinates(\n    $street,\n    $streetNumber,\n    $city,\n    $zip,\n    $country\n);\n```\n\n**getAddress**\n\n\u003e Get address from latitude/longitude coordinates.\n\n``` php\n$latitude = 51.0363935;\n$longitude = 3.7121008;\n\n$result = Geolocation::getAddress(\n    $latitude,\n    $longitude\n);\n```\n\nCheck [the Geolocation class source](./src/Geolocation.php).\n\n## Symfony bundle\n\nI've also created a Symfony bundle.\nView the [Geolocation bundle](https://github.com/jeroendesloovere/geolocation-bundle).\n\n## Tests\n\nWe have tests to make sure everything works as expected.\nFirst execute `composer install`.\nThen execute `vendor/bin/phpunit tests`.\n\n### Coding Syntax\n\nWe use [squizlabs/php_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) to maintain the code standards.\nType the following to execute them:\n```bash\n# To view the code errors\nvendor/bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --report=full \"src\"\n\n# OR to fix the code errors\nvendor/bin/phpcbf --standard=psr2 --extensions=php --warning-severity=0 --report=full \"src\"\n```\n\u003e [Read documentation about the code standards](https://github.com/squizlabs/PHP_CodeSniffer/wiki)\n\n## Documentation\n\nThe class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.\n\n## Contributing\n\nIt would be great if you could help us improve this class. GitHub does a great job in managing collaboration by providing different tools, the only thing you need is a [GitHub](http://github.com) login.\n\n* Use **Pull requests** to add or update code\n* **Issues** for bug reporting or code discussions\n* Or regarding documentation and how-to's, check out **Wiki**\nMore info on how to work with GitHub on help.github.com.\n\n## License\n\nThe module is licensed under [MIT](./LICENSE). In short, this license allows you to do everything as long as the copyright statement stays present.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroendesloovere%2Fgeolocation-php-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeroendesloovere%2Fgeolocation-php-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeroendesloovere%2Fgeolocation-php-api/lists"}