PHPackages                             riverside/php-osrm - 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. riverside/php-osrm

ActiveLibrary

riverside/php-osrm
==================

PHP client for Project-OSRM.

2.0.0(1y ago)1126.7k↓65.8%6MITPHPPHP &gt;=7.0CI failing

Since Jan 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/riverside/php-osrm)[ Packagist](https://packagist.org/packages/riverside/php-osrm)[ Docs](https://github.com/riverside/php-osrm)[ RSS](/packages/riverside-php-osrm/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

php-osrm
========

[](#php-osrm)

PHP client for Project-OSRM.

BuildStableLicense[![CI](https://github.com/riverside/php-osrm/actions/workflows/test.yml/badge.svg)](https://github.com/riverside/php-osrm/actions/workflows/test.yml)[![Latest Stable Version](https://camo.githubusercontent.com/e58b6902215df2a954b27c5b2587b616942785a6b6c106d0a297cbeda22e7b6b/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d6f73726d2f762f737461626c65)](https://packagist.org/packages/riverside/php-osrm)[![License](https://camo.githubusercontent.com/2435b90533dcaaeef8045545058c18c64e26a40974ff4257940e627dfb52635e/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f7068702d6f73726d2f6c6963656e7365)](https://packagist.org/packages/riverside/php-osrm)Installation
------------

[](#installation)

- If Composer is already installed

```
composer require riverside/php-osrm

```

- If Composer is not installed on your system yet, you may go ahead and install it using this command line:

```
$ curl -sS https://getcomposer.org/installer | php

```

Next, add the following require entry to the `composer.json` file in the root of your project.

```
{
    "require" : {
        "riverside/php-osrm" : "^2.0"
    }
}
```

Finally, use Composer to install **php-osrm** and its dependencies:

```
$ php composer.phar install

```

Loading
-------

[](#loading)

```
require __DIR__ . '/vendor/autoload.php';
```

API
---

[](#api)

- [Nearest](https://github.com/riverside/php-osrm/tree/master/examples/nearest.php) - Snaps a coordinate to the street network and returns the nearest `n` matches.
- [Route](https://github.com/riverside/php-osrm/tree/master/examples/route.php) - Finds the fastest route between coordinates in the supplied order.
- [Table](https://github.com/riverside/php-osrm/tree/master/examples/table.php) - Computes the duration of the fastest route between all pairs of supplied coordinates. Returns the durations or distances or both between the coordinate pairs.
- [Match](https://github.com/riverside/php-osrm/tree/master/examples/matcher.php) - Map matching matches/snaps given GPS points to the road network in the most plausible way.
- [Trip](https://github.com/riverside/php-osrm/tree/master/examples/trip.php) - Solves the Traveling Salesman Problem using a greedy heuristic (farthest-insertion algorithm) for 10 or more waypoints and uses brute force for less than 10 waypoints.
- [Tile](https://github.com/riverside/php-osrm/tree/master/examples/tile.php) - Generates [Mapbox Vector Tiles](https://docs.mapbox.com/api/maps/vector-tiles/) that can be viewed with a vector-tile capable slippy-map viewer.
- [Isochrones](https://github.com/riverside/php-osrm/tree/master/examples/isochrones.php) - Generates travel time isochrones in GeoJSON format.

Links
-----

[](#links)

- [Project-OSRM (official website)](https://project-osrm.org/)
- [Project-OSRM (GitHub)](https://github.com/Project-OSRM)
- [OSRM (OpenStreetMap.org)](https://wiki.openstreetmap.org/wiki/Open_Source_Routing_Machine)
- [ORS (OpenRouteService.org)](https://openrouteservice.org/)

###  Health Score

39

↑

LowBetter than 87% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.4% 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 ~567 days

Total

4

Last Release

559d ago

Major Versions

1.2.0 → 2.0.02024-09-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/17dd08ce9964258b22baca5a0a36d0dcf17d5cfb992462e40e6877e64c4fb453?d=identicon)[riverside](/maintainers/riverside)

---

Top Contributors

[![riverside](https://avatars.githubusercontent.com/u/43607?v=4)](https://github.com/riverside "riverside (60 commits)")[![vukbgit](https://avatars.githubusercontent.com/u/7385327?v=4)](https://github.com/vukbgit "vukbgit (1 commits)")

---

Tags

openstreetmaposmosrmosrm-apiphpphp-apiphp-clientphp-osrmproject-osrmroutingrouting-enginerouting-machinephpdistanceosmOpenStreetMaposrm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/riverside-php-osrm/health.svg)

```
[![Health](https://phpackages.com/badges/riverside-php-osrm/health.svg)](https://phpackages.com/packages/riverside-php-osrm)
```

###  Alternatives

[dantsu/php-osm-static-api

PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.

97133.7k1](/packages/dantsu-php-osm-static-api)[kenguest/services-openstreetmap

More information available at https://pear.php.net/package/Services\_OpenStreetMap

20341.2k](/packages/kenguest-services-openstreetmap)[mediawiki/maps

Adds various mapping features to MediaWiki

78143.2k3](/packages/mediawiki-maps)[riverside/php-nominatim

PHP client for Nominatim, a search engine for OpenStreetMap data.

1225.3k1](/packages/riverside-php-nominatim)[jeroendesloovere/distance

Get distance between two locations using PHP.

3461.9k](/packages/jeroendesloovere-distance)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67723.5k15](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

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