{"id":19052375,"url":"https://github.com/cyrille37/yapafo","last_synced_at":"2025-10-16T19:21:01.172Z","repository":{"id":2902868,"uuid":"3911144","full_name":"Cyrille37/yapafo","owner":"Cyrille37","description":"Yet Another Php Api For Openstreetmap (read/write with Api, read with XApi or Overpass)","archived":false,"fork":false,"pushed_at":"2024-11-08T12:12:08.000Z","size":410,"stargazers_count":11,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T13:49:35.807Z","etag":null,"topics":["api","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cyrille37.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":"2012-04-02T20:16:55.000Z","updated_at":"2024-11-08T12:03:45.000Z","dependencies_parsed_at":"2024-06-01T11:32:55.284Z","dependency_job_id":"3cc486a0-3fb7-42f7-b761-9aeb651c3ffd","html_url":"https://github.com/Cyrille37/yapafo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyrille37%2Fyapafo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyrille37%2Fyapafo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyrille37%2Fyapafo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyrille37%2Fyapafo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyrille37","download_url":"https://codeload.github.com/Cyrille37/yapafo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249381001,"owners_count":21261227,"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":["api","openstreetmap","php"],"created_at":"2024-11-08T23:26:10.603Z","updated_at":"2025-10-16T19:21:01.090Z","avatar_url":"https://github.com/Cyrille37.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yet Another Php Api For OpenStreetMap\n\n**yapafo** is a library which permits to authenticate, read and write objects in the OpenStreetMap database.\n\nIt's not an user friendly `App` but a tool for processing OSM data ;-)\n\n## FEATURES\n\n- Read (query) objects from **API**, **XAPI** and **Overpass**.\n- Write (create, update, delete) objects on **API**.\n- Authenticate with **Basic** or **OAuth 2**.\n- Class for osm objects are **serializable**.\n- A bit of **geometry** stuff are available locally (on query result)\n  - is node inside/outside polygon\n  - get gravity center for relation or way\n- it's for developer, so by default debug is on, it use test API endpoint\n- ...\n\n## Installation\n\n- install dependencies\n  - `composer install`\n\n## The configuration\n\nBy default:\n  - API operations are done on Osm developement instance at `master.apis.dev.openstreetmap.org` ;\n    - Write operations are carried out in \"simulation\" mode, so that no queries are made.\n  - Overpass queries are done on `overpass-api.de` ;\n  - XAPI  queries are done on `overpass-api.de` ;\n  - Print some tech message because logger level is Notice.\n\nTo overide those default behaviors, create file `.env` and set\n  - `simulation = false` to really write on API\n  - `osm_api_url = https://api.openstreetmap.org/api/0.6` to query and update on production OSM instance\n\nWhen developing\n  - you can avoid repetitive call to services by activatin the cache\n    - `osm_api_cacheFolder = a_folder`\n  - you can store in file each out/in from services\n    - `outputFolder = a_folder`\n\nRead `.env.example` to know more about configuration.\n\n## Generate an Access Token\n\nThe command-line `./vendor/bin/oauth-console.php` will drive you on getting an OAuth2 Access Token, launch it and read the instructions.\n\nThe process consists of several stages:\n1. choose the OSM server instance\n2. choose the permissions you need\n3. enter Application ID and Secret\n  - if you have to create an Application\n  - visit `\u003cthe instance you choose\u003e/oauth2/applications/`\n    - for example the test instance https://master.apis.dev.openstreetmap.org/oauth2/applications/\n  - create a new Application\n    - with redirect to `urn:ietf:wg:oauth:2.0:oob`\n    - and needed scopes\n    - I don't know about 'confidential' option\n4. get an authorization code\n5. finally, get the precious Access Token you need to access some services as an authenticated user.\n\nTo facilitate the procedure for obtaining the token, a Web page is **currently under construction** at `examples-web/OAuthRequestAccess.php`\n\n## Tuto and examples\n\n### examples-console\n\nLook at the code to learn more abour Yapafo.\n\n### examples-web\n\nWork in progress\n\n## BUG and Discussions\n\n- https://github.com/Cyrille37/yapafo/issues\n\n## REQUIREMENTS\n\nRequirements are covered by `composer.json`.\n\nPhp \u003e=7.4 et \u003c8.3.\n\nPhp extensions:\n\n- [SimpleXml](https://www.php.net/manual/en/book.simplexml.php)\n\nPhp libraries:\n\n- [psr/log](https://github.com/php-fig/log)\n- [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)\n- [jbelien/oauth2-openstreetmap](https://github.com/jbelien/oauth2-openstreetmap)\n  - which is a provider for [league/oauth2-client](https://github.com/thephpleague/oauth2-client)\n\n## References\n\n- The OAuth 2 Protocol : https://oauth.net/2/ and https://datatracker.ietf.org/doc/html/rfc6749\n- OSM OAuth doc : http://wiki.openstreetmap.org/wiki/OAuth\n- [PSR-3: Logger Interface](https://www.php-fig.org/psr/psr-3/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrille37%2Fyapafo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrille37%2Fyapafo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrille37%2Fyapafo/lists"}