{"id":36386425,"url":"https://github.com/lase-peco/geocoder","last_synced_at":"2026-01-11T15:02:43.550Z","repository":{"id":46385571,"uuid":"416641506","full_name":"lase-peco/geocoder","owner":"lase-peco","description":"A small geocoding library for Laravel.","archived":false,"fork":false,"pushed_at":"2024-12-15T16:31:21.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-05T09:50:09.214Z","etag":null,"topics":["address","geo","geocoding","laravel","library"],"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/lase-peco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-13T07:55:52.000Z","updated_at":"2024-12-15T16:31:10.000Z","dependencies_parsed_at":"2022-09-22T14:25:59.696Z","dependency_job_id":null,"html_url":"https://github.com/lase-peco/geocoder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lase-peco/geocoder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lase-peco%2Fgeocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lase-peco%2Fgeocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lase-peco%2Fgeocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lase-peco%2Fgeocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lase-peco","download_url":"https://codeload.github.com/lase-peco/geocoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lase-peco%2Fgeocoder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28309620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T14:58:17.114Z","status":"ssl_error","status_checked_at":"2026-01-11T14:55:53.580Z","response_time":60,"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","geo","geocoding","laravel","library"],"created_at":"2026-01-11T15:02:43.417Z","updated_at":"2026-01-11T15:02:43.539Z","avatar_url":"https://github.com/lase-peco.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# geocoder\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/lase-peco/geocoder.svg?style=flat-square)](https://packagist.org/packages/lase-peco/geocoder)\n[![Total Downloads](https://img.shields.io/packagist/dt/lase-peco/geocoder.svg?style=flat-square)](https://packagist.org/packages/lase-peco/geocoder)\n\nA small geocoder library for laravel.\n\n## Notes\n\nThis whole package is depending on the API [nominatim.org](https://nominatim.org/release-docs/develop/).\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require lase-peco/gecoder\n```\n\nThen publish the config file ```geocoder.php``` with the following command:\n\n``` bash\nphp artisan vendor:publish --provider=\"LasePeCo\\Geocoder\\ServiceProvider\" --tag=\"config\"\n```\nThe API from nominatim has a request limit of an absolute maximum of 1 request per second. this is defined in th config file, which you can change at your on risk. you can read about it under [operations.osmfoundation.org/policies](https://operations.osmfoundation.org/policies/nominatim/). \n\nAlso in the config file you can define how long should this library cache the results of your searches. The default is one Month.\n\n## Usage\n\nWith the help of the facade ```Geocoder``` you can call two main functions  ```search``` and ```reverse```.\n\n### The search function\n\nYou can call the ```search``` function on the  ```Geocoder``` facade and provide it directly with the ```(string)``` address.\n\nthis kind of search 'Free-form query' process the provided (string) address first left-to-right and\nthen right-to-left if that fails. So you may search for ```pilkington avenue, birmingham``` as well as for ```birmingham, pilkington avenue```.\n\nCommas are optional, but improve performance by reducing the complexity of the search.\n\nYou can also provide the search function with a part of the address,but the result might not be accurate.\n``` php\nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::search('Rudolf-Diesel-Str. 115, 46485 Wesel') \n``` \n\nIt will return a default json response with the results for the provided address which is accessible as a collection:\n\n``` php\nIlluminate\\Support\\Collection {\n  items:[\n    0 =\u003e {\n      \"place_id\": 317291459\n      \"licence\": \"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\"\n      \"osm_type\": \"way\"\n      \"osm_id\": 915146453\n      \"boundingbox\": [\n            0 =\u003e \"51.6674904\"\n            1 =\u003e \"51.6679331\"\n            2 =\u003e \"6.6641183\"\n            3 =\u003e \"6.665015\"\n           ]\n      \"lat\": \"51.667710650000004\"\n      \"lon\": \"6.664615146813532\"\n      \"display_name\": \"Cubes Wesel, 115, Rudolf-Diesel-Straße, Obrighoven, Obrighoven-Lackhausen, Wesel, Kreis Wesel, Nordrhein-Westfalen, 46485, Deutschland\"\n      \"class\": \"building\"\n      \"type\": \"commercial\"\n      \"importance\": 0.631\n    }\n  ]\n}\n```\nFurthermore, you can provide the  ```search``` function with a new object of the ```StructuredAddress``` class, through which you can construct the address:\n\n**This method is preferred to enable the API to find the address better and faster.**\n\n``` php\nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\nuse LasePeCo\\Geocoder\\StructuredAddress;\n\n$address = new StructuredAddress();\n\n$address-\u003estreet('Rudolf-Diesel-Str. 115')\n        -\u003ecity('Wesel')\n        -\u003epostalcode('46485')\n        -\u003estate('Nordrhein-Westfalen')\n        -\u003ecountry('Deutschland');\n\nGeocoder::search($address);\n```\n***\n### The reverse function\n\nWith the ```reverse``` function you can reverse search the address with the help of its latitude and longitude: \n\n``` php\nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::reverse('lat', 'lon') \n``` \nIt will return the same default json response which is accessible as a collection.\n\n***\n\n##Further functions\n\nAll the following functions are able to be used with the ```search``` and ```reverse``` functions.\n\n### withAddressDetails()\n\nIf you call the ````withAddressDetails()```` on the ```Geocoder``` facade you will get the address detailed:\n\n``` php\nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::withAddressDetails()-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel') \n\n//retrun\n\n\"address\": {\n   \"building\": \"Cubes Wesel\"\n   \"house_number\": \"115\"\n   \"road\": \"Rudolf-Diesel-Straße\"\n   \"suburb\": \"Obrighoven\"\n   \"town\": \"Wesel\"\n   \"county\": \"Kreis Wesel\"\n   \"state\": \"Nordrhein-Westfalen\"\n   \"postcode\": \"46485\"\n   \"country\": \"Deutschland\"\n   \"country_code\": \"de\"\n  }\n``` \n### withExtraTags()\nIf you call the ````withExtraTags()```` on the ```Geocoder``` facade you will get extra tag for the address:\n\n``` php\nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::withExtraTags()-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel') \n\n//retrun\n\n\"extratags\": {\n  \"building:levels\": \"2\"\n}\n``` \n### language() \n\nCall the function ```language()``` on the facade ```Geocoder``` with the language as a parameter to translate the result of the search.\n\n``` php \nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::withAddressDetails()-\u003ewithExtraTags()-\u003elanguage('en')-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel');\n\n//return\n\nIlluminate\\Support\\Collection {\n  #items: [\n    0 =\u003e {\n      \"place_id\": 317291459\n      \"licence\": \"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright\"\n      \"osm_type\": \"way\"\n      \"osm_id\": 915146453\n      \"boundingbox\":[\n        0 =\u003e \"51.6674904\"\n        1 =\u003e \"51.6679331\"\n        2 =\u003e \"6.6641183\"\n        3 =\u003e \"6.665015\"\n      ]\n      \"lat\": \"51.667710650000004\"\n      \"lon\": \"6.664615146813532\"\n      \"display_name\": \"Cubes Wesel, 115, Rudolf-Diesel-Straße, Obrighoven, Obrighoven-Lackhausen, Wesel, Kreis Wesel, North Rhine-Westphalia, 46485, Germany\"\n      \"class\": \"building\"\n      \"type\": \"commercial\"\n      \"importance\": 0.631\n      \"address\": {#1853 ▼\n        \"building\": \"Cubes Wesel\"\n        \"house_number\": \"115\"\n        \"road\": \"Rudolf-Diesel-Straße\"\n        \"suburb\": \"Obrighoven\"\n        \"town\": \"Wesel\"\n        \"county\": \"Kreis Wesel\"\n        \"state\": \"North Rhine-Westphalia\"\n        \"postcode\": \"46485\"\n        \"country\": \"Germany\"\n        \"country_code\": \"de\"\n      }\n      \"extratags\": {#1861 ▼\n        \"building:levels\": \"2\"\n      }\n    }\n  ]\n}\n```\n### withNameDetails() \n\nCall the function ```withNameDetails()``` on the facade ```Geocoder``` with the language as a parameter to translate the result of the search.\n\n``` php \nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::withNameDetails()-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel');\n\n//return\n\n\"namedetails\": {\n  \"name\": \"Cubes Wesel\"\n}\n```\n\n### format() \n\nThis package supports the following formats: ```xml```,```json```,```jsonv2```,```geojson```,```geocodejson```.\n\nCall the function ```format()``` on the facade ```Geocoder``` with the desired format as a parameter.\n\nFor the formats ```xml```and ```json``` there is two functions that you can call ```xml()``` and ```json()```.\n\n``` php \nuse LasePeCo\\Geocoder\\Facades\\Geocoder;\n\nGeocoder::format('xml')-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel')\n//or\nGeocoder::xml()-\u003esearch('Rudolf-Diesel-Str. 115, 46485 Wesel')\n\n//return\n\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\" ?\u003e\n\u003csearchresults timestamp='Fri, 15 Oct 21 07:55:41 +0000' attribution='Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright' querystring='Rudolf-Diesel-Str. 115, 46485 Wesel' exclude_place_ids='317291459' more_url='https://nominatim.openstreetmap.org/search/?q=Rudolf-Diesel-Str.+115%2C+46485+Wesel\u0026amp;exclude_place_ids=317291459\u0026amp;format=xml'\u003e \n    \u003cplace place_id='317291459' osm_type='way' osm_id='915146453' place_rank='30' address_rank='30' boundingbox=\"51.6674904,51.6679331,6.6641183,6.665015\" lat='51.667710650000004' lon='6.664615146813532' display_name='Cubes Wesel, 115, Rudolf-Diesel-Straße, Obrighoven, Obrighoven-Lackhausen, Wesel, Kreis Wesel, Nordrhein-Westfalen, 46485, Deutschland' class='building' type='commercial' importance='0.631'/\u003e\n\u003c/searchresults\u003e \n\n```\n\n\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email a.dabak@lase-peco.com instead of using the issue tracker.\n\n## Credits\n\n- [Ahmed Dabak](https://github.com/lase-peco)\n- [Abdulsalam Emesh](https://github.com/lase-peco)\n- [All Contributors](CONTRIBUTING.md)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flase-peco%2Fgeocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flase-peco%2Fgeocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flase-peco%2Fgeocoder/lists"}