{"id":19357758,"url":"https://github.com/joomla-framework/openstreetmap-api","last_synced_at":"2025-04-23T11:30:33.296Z","repository":{"id":17268692,"uuid":"20038385","full_name":"joomla-framework/openstreetmap-api","owner":"joomla-framework","description":"[DEPRECATED] Joomla Framework OpenStreetMap Package","archived":false,"fork":false,"pushed_at":"2021-09-18T11:11:10.000Z","size":77,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":17,"default_branch":"2.0-dev","last_synced_at":"2025-04-02T14:21:50.548Z","etag":null,"topics":["joomla","joomla-framework","openstreetmap","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joomla-framework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-21T21:41:27.000Z","updated_at":"2022-12-16T21:53:38.000Z","dependencies_parsed_at":"2022-09-13T01:00:50.657Z","dependency_job_id":null,"html_url":"https://github.com/joomla-framework/openstreetmap-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fopenstreetmap-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fopenstreetmap-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fopenstreetmap-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomla-framework%2Fopenstreetmap-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joomla-framework","download_url":"https://codeload.github.com/joomla-framework/openstreetmap-api/tar.gz/refs/heads/2.0-dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250424932,"owners_count":21428469,"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":["joomla","joomla-framework","openstreetmap","php"],"created_at":"2024-11-10T07:09:05.453Z","updated_at":"2025-04-23T11:30:33.018Z","avatar_url":"https://github.com/joomla-framework.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## The OpenStreetMap Package [![Build Status](https://travis-ci.org/joomla-framework/openstreetmap-api.png?branch=master)](https://travis-ci.org/joomla-framework/openstreetmap-api)\r\n\r\n### Deprecated\r\n\r\nThe `joomla/openstreetmap` package is deprecated with no further updates planned.\r\n\r\n### Using the OpenStreetMap Package\r\nThe intention of the OpenStreetMap package is to provide an easy straightforward interface to work with OpenStreetMap. This is based on version 0.6 of the OpenStreetMap API. You can find more information about the OpenStreetMap API at [https://wiki.openstreetmap.org/wiki/API_v0.6](https://wiki.openstreetmap.org/wiki/API_v0.6).\r\nThe OpenStreetMap package is built upon the `Joomla\\OAuth1` package which provides OAuth 1.0 security infrastructure for the communications. The `Joomla\\Http` package is also used as an easy way for the non-secure information exchanges.\r\n\r\n### Initiating the OpenStreetMap class\r\nInitiating OpenStreetMap is just a couple lines of code:\r\n\r\n```php\r\nuse Joomla\\OpenStreetMap\\OpenStreetMap;\r\n\r\n$osm = new OpenStreetMap;\r\n```\r\n\r\nThis creates basic OpenStreetMap object which can access publically available GET methods.\r\nBut when you want to send data or get private data, you need to use the `Joomla\\OpenStreetMap\\OAuth` object too.\r\n\r\nTo initialise the `Joomla\\OpenStreetMap\\OAuth` object, you must supply an options array, a `Joomla\\Http\\Http` instance for HTTP requests, a `Joomla\\Input\\Input` instance to process request data from OAuth requests, and a `Joomla\\Application\\AbstractWebApplication` instance to handle OAuth requests.\r\n\r\n```php\r\nuse Joomla\\Http\\Http;\r\nuse Joomla\\OpenStreetMap\\OAuth;\r\nuse Joomla\\OpenStreetMap\\OpenStreetMap;\r\n\r\n$key    = 'your_key';\r\n$secret = 'your_secret';\r\n\r\n$options = array('consumer_key' =\u003e $key, 'consumer_secret' =\u003e $secret, 'sendheaders' =\u003e true);\r\n\r\n$client = new Http;\r\n\r\n$application = $this-\u003egetApplication();\r\n\r\n$oauth = new OAuth($options, $client, $application-\u003einput, $application);\r\n$oauth-\u003eauthenticate();\r\n\r\n$osm = new OpenStreetMap($oauth);\r\n```\r\n\r\nTo obtain a key and secret, you have to obtain an account at OpenStreetMap. Through your account you need to [register](https://www.openstreetmap.org/user/username/oauth_clients/new) your application along with a callback URL.\r\n\r\n### Accessing OpenStreetMap API\r\nThis API will do all types of interactions with OpenStreetMap API. This has been categorized in to 5 main sections: Changeset, Element, GPS, Info and User. All those inherit from `Joomla\\OpenStreetMap\\OpenStreetMapObject` and can be initiated through the magic `__get` method of the OpenStreetMap class. Methods contained in each type of object are closely related to the OpenStreetMap API calls.\r\n\r\n### General Usage\r\nFor an example, to get an element with a known identifier you need to just add following two lines additionally after creating `$osm` .\r\n\r\n```php\r\n$element = $osm-\u003eelements;\r\n$result = $element-\u003ereadElement('node', 123);\r\n\r\n// To view the \\SimpleXMLElement object\r\nprint_r($result);\r\n```\r\n\r\nFor sending information to server you must use OAuth authentication. Following is a complete sample application of creating a new changeset. Later you can use your own changeset to add elements you want.\r\n\r\n```php\r\nuse Joomla\\Http\\Http;\r\nuse Joomla\\OpenStreetMap\\OAuth;\r\nuse Joomla\\OpenStreetMap\\OpenStreetMap;\r\n\r\n$key    = 'your_key';\r\n$secret = 'your_secret';\r\n\r\n$options = array('consumer_key' =\u003e $key, 'consumer_secret' =\u003e $secret, 'sendheaders' =\u003e true);\r\n\r\n$client = new Http;\r\n\r\n$application = $this-\u003egetApplication();\r\n\r\n$oauth = new OAuth($options, $client, $application-\u003einput, $application);\r\n$oauth-\u003eauthenticate();\r\n\r\n$osm = new OpenStreetMap($oauth);\r\n\r\n$changeset = $osm-\u003echangesets;\r\n\r\n$changesets = array(\r\n\t'comment'    =\u003e 'My First Changeset',\r\n\t'created_by' =\u003e 'JoomlaOpenStreetMap'\r\n);\r\n\r\n$result = $changeset-\u003ecreateChangeset($changesets);\r\n\r\n// Returned value contains the identifier of new changeset\r\nprint_r($result);\r\n```\r\n\r\n### More Information\r\nFollowing resources contain more information: [OpenStreetMap API](https://wiki.openstreetmap.org/wiki/API)\r\n\r\n### Installation via Composer\r\nAdd `\"joomla/openstreetmap\": \"2.0.*@dev\"` to the require block in your composer.json and then run `composer install`.\r\n\r\n```json\r\n{\r\n\t\"require\": {\r\n\t\t\"joomla/openstreetmap\": \"2.0.*@dev\"\r\n\t}\r\n}\r\n```\r\n\r\nAlternatively, you can simply run the following from the command line:\r\n\r\n```sh\r\ncomposer require joomla/openstreetmap \"2.0.*@dev\"\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Fopenstreetmap-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoomla-framework%2Fopenstreetmap-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomla-framework%2Fopenstreetmap-api/lists"}