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(10mo ago)11113[3 issues](https://github.com/Cyrille37/yapafo/issues)GPL-3.0-or-laterPHPPHP &gt;=7.4 ~8.3CI failing

Since Apr 29Pushed 10mo ago3 watchersCompare

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

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

40

—

FairBetter than 86% of packages

Maintenance49

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity73

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

308d ago

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

v2.2PHP &gt;=7.4 ~8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/368965?v=4)[Cyrille Giquello](/maintainers/Cyrille37)[@Cyrille37](https://github.com/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

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/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.

528.5M7](/packages/avalara-avataxclient)[jasara/php-amzn-selling-partner-api

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

1348.7k1](/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)

PHPackages © 2026

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