{"id":15058984,"url":"https://github.com/riverside/php-nominatim","last_synced_at":"2025-04-10T05:12:11.771Z","repository":{"id":62536070,"uuid":"232178330","full_name":"riverside/php-nominatim","owner":"riverside","description":":pushpin: PHP client for Nominatim, a search engine for OpenStreetMap data.","archived":false,"fork":false,"pushed_at":"2024-11-17T20:58:06.000Z","size":56,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:23:04.964Z","etag":null,"topics":["address-lookup","geocoding","nominatim","openstreetmap","osm","reverse-geocoding","search-engine"],"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/riverside.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":"2020-01-06T20:18:04.000Z","updated_at":"2024-11-17T21:05:46.000Z","dependencies_parsed_at":"2025-02-16T15:43:00.524Z","dependency_job_id":null,"html_url":"https://github.com/riverside/php-nominatim","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-nominatim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-nominatim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-nominatim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riverside%2Fphp-nominatim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riverside","download_url":"https://codeload.github.com/riverside/php-nominatim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247941702,"owners_count":21022038,"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":["address-lookup","geocoding","nominatim","openstreetmap","osm","reverse-geocoding","search-engine"],"created_at":"2024-09-24T22:34:57.840Z","updated_at":"2025-04-10T05:12:11.725Z","avatar_url":"https://github.com/riverside.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-nominatim\nA PHP client for Nominatim, the search engine for OpenStreetMap data.\n\n| Build | Stable | License |\n| --- | --- | --- |\n| [![CI](https://github.com/riverside/php-nominatim/actions/workflows/test.yml/badge.svg)](https://github.com/riverside/php-nominatim/actions/workflows/test.yml) | [![Latest Stable Version](https://poser.pugx.org/riverside/php-nominatim/v/stable)](https://packagist.org/packages/riverside/php-nominatim) | [![License](https://poser.pugx.org/riverside/php-nominatim/license)](https://packagist.org/packages/riverside/php-nominatim) |\n\n### Installation\n- If Composer is already installed\n```\ncomposer require riverside/php-nominatim\n```\n- If Composer is not installed on your system yet, you may go ahead and install it using this command line:\n```\n$ curl -sS https://getcomposer.org/installer | php\n```\nNext, add the following require entry to the composer.json file in the root of your project.\n```json\n{\n    \"require\" : {\n        \"riverside/php-nominatim\" : \"^2.0\"\n    }\n}\n```\nFinally, use Composer to install php-nominatim and its dependencies:\n```\n$ php composer.phar install\n```\n\n### Loading\n```php\nrequire __DIR__ . '/vendor/autoload.php';\n```\n\n### Search (geocoding)\nLook up a location from a textual description or address.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $response = $client-\u003esearch('Madison Square Garden, NY');\n    if ($response-\u003eisOK()) {\n        echo $response-\u003egetLat(0) . \", \" . $response-\u003egetLng(0);\n    } else {\n        echo 'Location not found.';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Reverse geocoding\nGenerates an address from a latitude and longitude.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $response = $client-\u003ereverse(48.8539373, 2.2825966);\n    if ($response-\u003eisOK()) {\n        echo $response-\u003egetAddress(0);\n    } else {\n        echo 'Address not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Address lookup\nQuery the address and other details of one or multiple OSM objects like node, way or relation.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $client-\u003esetAddressDetails(1);\n    $response = $client-\u003elookup('R146656,W104393803,N240109189');\n    if ($response-\u003eisOK()) {\n        echo '\u003cpre\u003e';\n        print_r($response-\u003etoArray());\n    } else {\n        echo 'Address not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Place details\nShow all details about a single place saved in the database.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $client-\u003esetAddressDetails(1);\n    $response = $client-\u003edetails(199375150);\n    if ($response-\u003eisOK())\n    {\n        echo '\u003cpre\u003e';\n        print_r($response-\u003etoArray());\n    } else {\n        echo 'Place not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Status\nCheck if the service and database is running, and when the database was last updated.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $response = $client-\u003estatus();\n    if ($response-\u003eisOK())\n    {\n        echo '\u003cpre\u003e';\n        print_r($response-\u003etoArray());\n    } else {\n        echo 'Status not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Deletable\nList objects that have been deleted in OSM but are held back in Nominatim in case the deletion was accidental.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $response = $client-\u003edeletable();\n    if ($response-\u003eisOK())\n    {\n        echo '\u003cpre\u003e';\n        print_r($response-\u003etoArray());\n    } else {\n        echo 'Deletable objects not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Polygons\nList of broken polygons detected by Nominatim.\n```php\n$client = new \\Riverside\\Nominatim\\Client();\ntry {\n    $response = $client-\u003epolygons();\n    if ($response-\u003eisOK())\n    {\n        echo '\u003cpre\u003e';\n        print_r($response-\u003etoArray());\n    } else {\n        echo 'Polygons not found';\n    }\n} catch (InvalidArgumentException $e) {\n    echo $e-\u003egetMessage();\n} catch (Exception $e) {\n    echo $e-\u003egetMessage();\n}\n```\n\n### Links\n- https://wiki.openstreetmap.org/wiki/Nominatim\n- https://github.com/openstreetmap/Nominatim\n- https://nominatim.openstreetmap.org/\n- https://nominatim.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friverside%2Fphp-nominatim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friverside%2Fphp-nominatim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friverside%2Fphp-nominatim/lists"}