PHPackages                             jansuchanek/ndistance - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jansuchanek/ndistance

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jansuchanek/ndistance
=====================

Geocoding + driving distance via Nominatim/OSRM — no API key needed

v1.0.0(6d ago)02↓100%MITPHPPHP &gt;=8.1CI failing

Since Mar 19Pushed 4d agoCompare

[ Source](https://github.com/JanSuchanek/ndistance)[ Packagist](https://packagist.org/packages/jansuchanek/ndistance)[ RSS](/packages/jansuchanek-ndistance/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

NDistance — Geocoding &amp; Driving Distance
============================================

[](#ndistance--geocoding--driving-distance)

Address geocoding + driving distance calculation using free APIs. No API key needed.

- **Nominatim** (OpenStreetMap) — address → lat/lng
- **OSRM** — driving distance &amp; duration

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

[](#installation)

```
composer require jansuchanek/ndistance
```

Usage
-----

[](#usage)

```
use NDistance\DistanceCalculator;

$calc = new DistanceCalculator(
    userAgent: 'MyApp/1.0',
    defaultCountry: 'cz',
);

// Geocode address
$coords = $calc->geocode('Brno, Česko');
// ['lat' => 49.19, 'lng' => 16.61]

// Driving distance between coordinates
$route = $calc->drivingDistance(50.08, 14.42, 49.19, 16.61);
// ['distance' => 205.3, 'duration' => 125]  (km, minutes)

// Check delivery range
$result = $calc->checkDistance(50.08, 14.42, 'Brno', 250.0);
// ['ok' => true, 'distance' => 205.3, 'duration' => 125, ...]
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- ext-curl

###  Health Score

39

—

LowBetter than 87% of packages

Maintenance99

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

6d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38ce2f53e74d810d50aca863e1a3b954f34f1629dd01a6a8c7d4d582e7459e63?d=identicon)[JanSuchanek](/maintainers/JanSuchanek)

---

Top Contributors

[![JanSuchanek](https://avatars.githubusercontent.com/u/310020?v=4)](https://github.com/JanSuchanek "JanSuchanek (5 commits)")

### Embed Badge

![Health badge](/badges/jansuchanek-ndistance/health.svg)

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

###  Alternatives

[desandro/imagesloaded

JavaScript is all like \_You images done yet or what?\_

8.9k435.5k1](/packages/desandro-imagesloaded)[ynacorp/nova-swatches

A beautiful color picking field for Laravel Nova.

22285.4k1](/packages/ynacorp-nova-swatches)

PHPackages © 2026

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