{"id":34001429,"url":"https://github.com/lightools/geocoding","last_synced_at":"2026-03-17T22:05:26.868Z","repository":{"id":57014915,"uuid":"57120029","full_name":"lightools/geocoding","owner":"lightools","description":"Simple address geocoding with exact results only - may be used for full address validation.","archived":false,"fork":false,"pushed_at":"2017-02-05T12:05:26.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T22:05:53.059Z","etag":null,"topics":["address-validation","geocoding"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightools.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-26T10:38:35.000Z","updated_at":"2016-04-26T10:39:04.000Z","dependencies_parsed_at":"2022-08-22T09:31:36.296Z","dependency_job_id":null,"html_url":"https://github.com/lightools/geocoding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lightools/geocoding","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightools%2Fgeocoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightools%2Fgeocoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightools%2Fgeocoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightools%2Fgeocoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightools","download_url":"https://codeload.github.com/lightools/geocoding/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightools%2Fgeocoding/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["address-validation","geocoding"],"created_at":"2025-12-13T09:51:54.835Z","updated_at":"2026-03-17T22:05:26.863Z","avatar_url":"https://github.com/lightools.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\nSimple address geocoding with exact results only - may be used for full address validation.\nFor example address ```Revoluční 11, Praha``` will be found, but ```Revoluční, Praha``` will be not.\n\n## Installation\n\n```sh\n$ composer require lightools/geocoding\n```\n\n## Simple Usage\n\n```php\ntry {\n    $httpClient = new Bitbang\\Http\\Clients\\CurlClient();\n    $geocoder = new Lightools\\Geocoding\\GoogleGeocoder($httpClient);\n    $geocoded = $geocoder-\u003egeocode('Revoluční 11, Praha');\n\n    echo $geocoded-\u003egetLatitude();\n    echo $geocoded-\u003egetLongitude();\n    echo $geocoded-\u003egetPostalCode();\n\n} catch (Lightools\\Geocoding\\GeocodingFailedException $e) {\n    // e.g. HTTP request failed\n} catch (Lightools\\Geocoding\\NoExactResultException $e) {\n    // invalid or inaccurate address\n} catch (Lightools\\Geocoding\\QuotaLimitException $e) {\n    // rate limit exceeded\n}\n```\n\n### Chaining, caching, configuring\n\nThis library is shipped with simple caching geocoder and chain geocoder.\nYou can configure chain geocoder which exceptions will cause skipping to next geocoder by second parameter in constructor.\nIf you want to create your own, just implement interface ```IGeocoder```.\n\nFor Google geocoder, you can configure any query parameters you want, just call ```setParameters``` and setup for example language or components.\nSmartform geocoder has the same method, but there not too much to configure - only target countries.\n\n```php\n$httpClient = new Bitbang\\Http\\Clients\\CurlClient();\n\n$googleGeocoder = new Lightools\\Geocoding\\GoogleGeocoder($httpClient);\n$googleGeocoder-\u003esetParameters(['components' =\u003e 'country:CZ']);\n\n$smartformGeocoder = new Lightools\\Geocoding\\SmartformGeocoder('password', $httpClient);\n$smartformGeocoder-\u003esetParameters(['countries' =\u003e ['CZ']]);\n\n$chainGeocoder = new Lightools\\Geocoding\\ChainGeocoder([$smartformGeocoder, $googleGeocoder]);\n$cachedGeocoder = new Lightools\\Geocoding\\CachedGeocoder($chainGeocoder, __DIR__ . '/cache/geocoding');\n\n$cachedGeocoder-\u003egeocode('Václavské náměstí 837/11, Praha');\n```\n\n## How to run tests\n\n```sh\n$ vendor/bin/tester tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightools%2Fgeocoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightools%2Fgeocoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightools%2Fgeocoding/lists"}