PHPackages                             cyrille37/yapafo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cyrille37/yapafo

ActiveLibrary[API Development](/categories/api)

cyrille37/yapafo
================

Manipulate OpenStreetMap Data via OSM &amp; Overpass APIs.

v2.3.3(8mo ago)11113[3 issues](https://github.com/Cyrille37/yapafo/issues)GPL-3.0-or-laterPHPPHP &gt;=7.4 ~8.3CI failing

Since Apr 29Pushed 8mo ago3 watchersCompare

[ Source](https://github.com/Cyrille37/yapafo)[ Packagist](https://packagist.org/packages/cyrille37/yapafo)[ RSS](/packages/cyrille37-yapafo/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (9)Used By (0)

Yet Another Php Api For OpenStreetMap
=====================================

[](#yet-another-php-api-for-openstreetmap)

**yapafo** is a library which permits to authenticate, read and write objects in the OpenStreetMap database.

It's not an user friendly `App` but a tool for processing OSM data ;-)

FEATURES
--------

[](#features)

- Read (query) objects from **API**, **XAPI** and **Overpass**.
- Write (create, update, delete) objects on **API**.
- Authenticate with **Basic** or **OAuth 2**.
- Class for osm objects are **serializable**.
- A bit of **geometry** stuff are available locally (on query result)
    - is node inside/outside polygon
    - get gravity center for relation or way
- it's for developer, so by default debug is on, it use test API endpoint
- ...

Installation
------------

[](#installation)

- install dependencies
    - `composer install`

The configuration
-----------------

[](#the-configuration)

By default:

- API operations are done on Osm developement instance at `master.apis.dev.openstreetmap.org` ;
    - Write operations are carried out in "simulation" mode, so that no queries are made.
- Overpass queries are done on `overpass-api.de` ;
- XAPI queries are done on `overpass-api.de` ;
- Print some tech message because logger level is Notice.

To overide those default behaviors, create file `.env` and set

- `simulation = false` to really write on API
- `osm_api_url = https://api.openstreetmap.org/api/0.6` to query and update on production OSM instance

When developing

- you can avoid repetitive call to services by activatin the cache
    - `osm_api_cacheFolder = a_folder`
- you can store in file each out/in from services
    - `outputFolder = a_folder`

Read `.env.example` to know more about configuration.

Generate an Access Token
------------------------

[](#generate-an-access-token)

The command-line `./vendor/bin/oauth-console.php` will drive you on getting an OAuth2 Access Token, launch it and read the instructions.

The process consists of several stages:

1. choose the OSM server instance
2. choose the permissions you need
3. enter Application ID and Secret

- if you have to create an Application
- visit `/oauth2/applications/`
    - for example the test instance
- create a new Application
    - with redirect to `urn:ietf:wg:oauth:2.0:oob`
    - and needed scopes
    - I don't know about 'confidential' option

4. get an authorization code
5. finally, get the precious Access Token you need to access some services as an authenticated user.

To facilitate the procedure for obtaining the token, a Web page is **currently under construction** at `examples-web/OAuthRequestAccess.php`

Tuto and examples
-----------------

[](#tuto-and-examples)

### examples-console

[](#examples-console)

Look at the code to learn more abour Yapafo.

### examples-web

[](#examples-web)

Work in progress

BUG and Discussions
-------------------

[](#bug-and-discussions)

-

REQUIREMENTS
------------

[](#requirements)

Requirements are covered by `composer.json`.

Php &gt;=7.4 et &lt;8.3.

Php extensions:

- [SimpleXml](https://www.php.net/manual/en/book.simplexml.php)

Php libraries:

- [psr/log](https://github.com/php-fig/log)
- [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)
- [jbelien/oauth2-openstreetmap](https://github.com/jbelien/oauth2-openstreetmap)
    - which is a provider for [league/oauth2-client](https://github.com/thephpleague/oauth2-client)

References
----------

[](#references)

- The OAuth 2 Protocol :  and
- OSM OAuth doc :
- [PSR-3: Logger Interface](https://www.php-fig.org/psr/psr-3/)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance55

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~226 days

Recently: every ~76 days

Total

8

Last Release

257d ago

PHP version history (2 changes)v2.1PHP &gt;=7.4 &lt;8.3

v2.2PHP &gt;=7.4 ~8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a8bf3ab3064904fab877842362f3c573324e4d8e5daa8f4d1c377c1c908e96d?d=identicon)[Cyrille37](/maintainers/Cyrille37)

---

Top Contributors

[![Cyrille37](https://avatars.githubusercontent.com/u/368965?v=4)](https://github.com/Cyrille37 "Cyrille37 (135 commits)")[![edewaele](https://avatars.githubusercontent.com/u/1607217?v=4)](https://github.com/edewaele "edewaele (3 commits)")

---

Tags

apiopenstreetmapphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cyrille37-yapafo/health.svg)

```
[![Health](https://phpackages.com/badges/cyrille37-yapafo/health.svg)](https://phpackages.com/packages/cyrille37-yapafo)
```

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69333.0M114](/packages/algolia-algoliasearch-client-php)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

517.9M7](/packages/avalara-avataxclient)[alexacrm/dynamics-webapi-toolkit

Web API toolkit for Microsoft Dynamics 365 and Dynamics CRM

81324.1k1](/packages/alexacrm-dynamics-webapi-toolkit)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[webit/w-firma-api

wFirma.pl API

1820.2k](/packages/webit-w-firma-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
