PHPackages                             getkirby/geo - 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. getkirby/geo

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

getkirby/geo
============

Kirby Geo

2.0.1(10mo ago)223.5k↓56.1%2[1 issues](https://github.com/getkirby/geo/issues)[1 PRs](https://github.com/getkirby/geo/pulls)MITPHPPHP &gt;=8.1.0

Since Dec 10Pushed 10mo ago7 watchersCompare

[ Source](https://github.com/getkirby/geo)[ Packagist](https://packagist.org/packages/getkirby/geo)[ Docs](https://getkirby.com)[ Fund](https://getkirby.com/buy)[ RSS](/packages/getkirby-geo/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

Kirby GEO Plugin
================

[](#kirby-geo-plugin)

This plugin adds basic geo search and conversion functionalities to Kirby.

### Supports

[](#supports)

- Current releases support Kirby 4 and 5
- For Kirby 3 support, please use [v1.0.2](https://github.com/getkirby/geo/releases/tag/1.0.2)

Geo Class Option
----------------

[](#geo-class-option)

### Geo::point($lat, $lng)

[](#geopointlat-lng)

Creates a new Kirby Geo Point

Example:

```
Geo::point(49.4883333, 8.4647222);
Geo::point('49.4883333, 8.4647222');
Geo::point([49.4883333, 8.4647222]);
Geo::point(['lat' => 49.4883333, 'lng' => 8.4647222]);
```

Afterwards you can get the latitude and longitude values of the point like this:

```
$point = Geo::point(49.4883333, 8.4647222);
echo $point->lat();
echo $point->lng();
```

### Geo::distance($pointA, $pointB)

[](#geodistancepointa-pointb)

Returns the distance between two geo points.

```
$mannheim = Geo::point(49.4883333, 8.4647222);
$hamburg  = Geo::point(53.553436, 9.992247);

echo 'The distance between Mannheim and Hamburg is: ' . Geo::distance($mannheim, $hamburg);
```

You can also return the distance in miles instead of kilometers

```
echo 'The distance between Mannheim and Hamburg is: ' . Geo::distance($mannheim, $hamburg, 'mi');
```

### Geo::niceDistance($pointA, $pointB)

[](#geonicedistancepointa-pointb)

Returns the distance between two geo points in a human readable way (i.e. 461.32 km)

```
$mannheim = Geo::point(49.4883333, 8.4647222);
$hamburg  = Geo::point(53.553436, 9.992247);

echo 'The distance between Mannheim and Hamburg is: ' . Geo::niceDistance($mannheim, $hamburg);
```

You can also return the "nice distance" in miles instead of kilometers

```
echo 'The distance between Mannheim and Hamburg is: ' . Geo::niceDistance($mannheim, $hamburg, 'mi');
```

### Geo::kilometersToMiles($km)

[](#geokilometerstomileskm)

Converts kilometers into miles:

```
echo Geo::kilometersToMiles(1000);
```

### Geo::milesToKilometers($mi)

[](#geomilestokilometersmi)

Converts miles into kilometers:

```
echo Geo::milesToKilometers(1000);
```

Radius Filter
-------------

[](#radius-filter)

The plugin automatically adds a new filter for all collections, which can be used to do a radius search:

```
$addresses = page('addresses')->children()->filterBy('location', 'radius', [
  'lat'    => 49.4883333,
  'lng'    => 8.4647222,
  'radius' => 10
]);
```

To make this work, the location field for each address page must be in the following format:

```
location: {lat},{lng}

```

or with a real life example:

```
location: 49.4883333,8.4647222

```

You can also filter in miles

```
$addresses = page('addresses')->children()->filterBy('location', 'radius', [
  'lat'    => 49.4883333,
  'lng'    => 8.4647222,
  'radius' => 10,
  'unit'   => 'mi'
]);
```

Field Methods
-------------

[](#field-methods)

The plugin also adds a set of field methods, which can be handy to work with locations

### $field-&gt;coordinates()

[](#field-coordinates)

Converts a field with the value format {lat},{lng} into a valid Kirby Geo Point Object:

```
$page->location()->coordinates()->lat();
$page->location()->coordinates()->lng();
```

### $field-&gt;distance($point)

[](#field-distancepoint)

Calculates the distance between a location field and another Kirby Geo Point:

```
$hamburg = Geo::point(53.553436, 9.992247);

echo $page->location()->distance($hamburg);
```

Of course you can run this in miles again:

```
$hamburg = Geo::point(53.553436, 9.992247);

echo $page->location()->distance($hamburg, 'mi');
```

### $field-&gt;niceDistance($point)

[](#field-nicedistancepoint)

Returns the distance in a more human friendly format:

```
$hamburg = Geo::point(53.553436, 9.992247);

echo $page->location()->niceDistance($hamburg);
```

What’s Kirby?
-------------

[](#whats-kirby)

- **[getkirby.com](https://getkirby.com)** – Get to know the CMS.
- **[Try it](https://getkirby.com/try)** – Take a test ride with our online demo. Or download one of our kits to get started.
- **[Documentation](https://getkirby.com/docs/guide)** – Read the official guide, reference and cookbook recipes.
- **[Issues](https://github.com/getkirby/kirby/issues)** – Report bugs and other problems.
- **[Feedback](https://feedback.getkirby.com)** – You have an idea for Kirby? Share it.
- **[Forum](https://forum.getkirby.com)** – Whenever you get stuck, don't hesitate to reach out for questions and support.
- **[Discord](https://chat.getkirby.com)** – Hang out and meet the community.
- **[Mastodon](https://mastodon.social/@getkirby)** – Spread the word.
- **[Bluesky](https://bsky.app/profile/getkirby.com)** – Spread the word.

---

License
-------

[](#license)

Credits
-------

[](#credits)

[Bastian Allgeier](https://getkirby.com)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance54

Moderate activity, may be stable

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 65.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 ~512 days

Total

5

Last Release

302d ago

Major Versions

1.0.2 → 2.0.02025-05-26

PHP version history (3 changes)1.0.0PHP &gt;=7.2.0

1.0.2PHP &gt;=7.4.0

2.0.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/da0d3433a1b7637495d024760cdce2fb9e4174d1a3f80d707626f95c81724534?d=identicon)[bastianallgeier](/maintainers/bastianallgeier)

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

![](https://www.gravatar.com/avatar/e89dc1e09ef4dbe7986140a861a0a2630011c6b8ad62f26e67e0ef10eb2f501c?d=identicon)[texnixe](/maintainers/texnixe)

![](https://www.gravatar.com/avatar/910e459690c98761ff47c8f5b0af29b440005ed926b2f386a2aeb033030d35e8?d=identicon)[lukasbestle](/maintainers/lukasbestle)

---

Top Contributors

[![bastianallgeier](https://avatars.githubusercontent.com/u/24532?v=4)](https://github.com/bastianallgeier "bastianallgeier (17 commits)")[![distantnative](https://avatars.githubusercontent.com/u/3788865?v=4)](https://github.com/distantnative "distantnative (7 commits)")[![afbora](https://avatars.githubusercontent.com/u/3393422?v=4)](https://github.com/afbora "afbora (2 commits)")

---

Tags

cmsgeokirbykirby3kirby4kirby5phppluginplugincmslocationgeokirby

### Embed Badge

![Health badge](/badges/getkirby-geo/health.svg)

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

###  Alternatives

[genxbe/kirby-ray

Helper tool that enables ray on all the extendable methods.

232.2k](/packages/genxbe-kirby-ray)[moritzebeling/kirby-favicon

Kirby plugin to meet all favicon needs

144.8k](/packages/moritzebeling-kirby-favicon)[winter/wn-sitemap-plugin

Sitemap plugin for Winter CMS

1042.6k1](/packages/winter-wn-sitemap-plugin)[johannschopplich/kirby-seo-audit

SEO analysis powered by Yoast for Kirby CMS

102.3k](/packages/johannschopplich-kirby-seo-audit)

PHPackages © 2026

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