{"id":23127881,"url":"https://github.com/ujamii/ujamii-geocoder","last_synced_at":"2025-10-04T14:03:27.058Z","repository":{"id":31198199,"uuid":"127165575","full_name":"ujamii/ujamii-geocoder","owner":"ujamii","description":"Connecting http://geocoder-php.org/Geocoder with TYPO3 DataHandler API","archived":false,"fork":false,"pushed_at":"2022-12-16T06:00:31.000Z","size":35,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-28T15:49:11.681Z","etag":null,"topics":["composer-package","geocoder","tca","typo3","typo3-cms-extension","typo3-extension"],"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/ujamii.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}},"created_at":"2018-03-28T16:04:39.000Z","updated_at":"2024-04-10T21:55:29.000Z","dependencies_parsed_at":"2023-01-14T18:32:17.241Z","dependency_job_id":null,"html_url":"https://github.com/ujamii/ujamii-geocoder","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fujamii-geocoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fujamii-geocoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fujamii-geocoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fujamii-geocoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ujamii","download_url":"https://codeload.github.com/ujamii/ujamii-geocoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230091567,"owners_count":18171528,"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":["composer-package","geocoder","tca","typo3","typo3-cms-extension","typo3-extension"],"created_at":"2024-12-17T09:15:31.557Z","updated_at":"2025-10-04T14:03:22.021Z","avatar_url":"https://github.com/ujamii.png","language":"PHP","readme":"# ujamii-geocoder\n\n[![Packagist](https://img.shields.io/packagist/v/ujamii/ujamii-geocoder.svg?colorB=green\u0026style=flat)](https://packagist.org/packages/ujamii/ujamii-geocoder)\n\nConnecting http://geocoder-php.org/Geocoder with TYPO3 DataHandler API.\nWith this extension you can easily add geo data to records while they are changed by editors in the TYPO3 backend. You just have to configure\nhow your entity \"looks like\" in the eyes of the geocoder via TCA anf that's it.\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Example](#example)\n* [TODOs](#todos)\n\n## Installation\n\nCurrently only works in composer mode of TYPO3, so\n\n```shell\ncomposer require ujamii/ujamii-geocoder\n```\n\n## Usage\n\nJust add a new config array to the `ctrl` section of your TCA.\n\n```php\n..['ctrl']['geocoder'] = [\n\t'triggerFields' =\u003e ['street', 'zip', 'city'],\n\t'getAddressString' =\u003e 'Your\\Namespace\\Domain\\Model\\YourEntity-\u003egetAddressString'\n];\n```\n\nAnd provide a method (e.g. in an entity or helper class) to generate a compound\naddress string based on the database data of one entity (example below).\n\n### Options\n\nThose options are possible:\n\n**triggerFields (mandatory)**\n\nChanges in those fields will trigger the process of geocoding.\n\n**getAddressString (mandatory)**\n\nA method called via `TYPO3\\CMS\\Core\\Utility\\GeneralUtility::callUserFunction` which is supposed\nto return a complete address string. The first parameter provided to this method is the merged\ndata array (unchanged entity data from db + changed values from the backend form).\n\nExample:\n```php\npublic function getAddressString($dataArray) {\n\treturn $dataArray['location'];\n}\n```\n\n**locale** (default: de)\n\nThe locale which is used in the geocoder. \n\n**latField** (default: lat)\n\nName of the target field for the latitude value.\n\n**lngField** (default: lng)\n\nName of the target field for the longitude value.\n\n**httpClientClass** (default: \\Http\\Adapter\\Guzzle6\\Client::class)\n\nClass name of the http client, see [possible packages](https://packagist.org/providers/php-http/client-implementation)\n\n**providerClass** (default: \\Geocoder\\Provider\\GoogleMaps\\GoogleMaps::class)\n\nClass name of the provider, see [possible packages](https://packagist.org/providers/geocoder-php/provider-implementation)\n\n**providerParams**\n\nOptional parameters for the provider. (e.g. an API key for Google Maps)\n\n**geocoderClass** (default: \\Geocoder\\StatefulGeocoder::class)\n\nClass name of the geocoder.\n\n## Example\n\nLet's assume the record is a news record in the database with 3 fields: location, lat and lng. The field location\ncontains something like `Alexanderplatz, Berlin, Deutschland` and lat and lng are the fields you want to be filled\nautomatically as soon as an editor changes the location.\n\nAdd this to your `typo3conf/ext/your_extension/Configuration/TCA/Overrides/tx_news_domain_model_news.php` \nor `typo3conf/ext/your_extension/Configuration/TCA/tx_ext_domain_model_entity.php` file.\n\n```php\n$GLOBALS['TCA']['tx_news_domain_model_news']['ctrl']['geocoder'] = [\n\t'triggerFields' =\u003e ['street', 'zip', 'city'],\n\t'getAddressString' =\u003e 'Your\\Namespace\\Domain\\Model\\YourEntity-\u003egetAddressString',\n\t'providerParams' =\u003e [\n        0 =\u003e null,\n        1 =\u003e null,\n        2 =\u003e '\u003cGMAPS_API_KEY\u003e'\n    ]\n];\n```\n\nIn `YourEntity`, add a method like this:\n```php\npublic function getAddressString($dataArray) {\n\treturn sprintf('%s, %s %s', $dataArray['street'], $dataArray['zip'], $dataArray['city']);\n}\n```\n\n## Usage as command or in scheduler\n\nThe extension also provides command to populate rows with 0 values for the lat/lng fields. \nIt reads the configuration from TCA and iterates through each configured table, searching with lat = 0 OR lng = 0. For each matching row, the geocoding\nprocess is executed and the values are then updated in the database. The command produces some log output to track what has been done.\n\nAs it is a default Symfony console command, this can also be called by a scheduler task.\n\n```php\nvendor/bin/typo3 geocoder:fillmissingdata\n```\n\n## TODOs\n\n* publish in TER\n* right now providerParams[0] is always filled with the httpClient, which may not work for all providers\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujamii%2Fujamii-geocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fujamii%2Fujamii-geocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujamii%2Fujamii-geocoder/lists"}