PHPackages                             sandfox/kdtree - 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. sandfox/kdtree

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

sandfox/kdtree
==============

A slow and possibly buggy implementation of a kdtree in php

0.1.0(12y ago)129173[2 issues](https://github.com/sandfox/kdtree/issues)MITPHPPHP &gt;=5.3.3

Since Sep 10Pushed 12y ago3 watchersCompare

[ Source](https://github.com/sandfox/kdtree)[ Packagist](https://packagist.org/packages/sandfox/kdtree)[ Docs](https://github.com/sandfox/kdtree)[ RSS](/packages/sandfox-kdtree/feed)WikiDiscussions master Synced 3w ago

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

KDTree
======

[](#kdtree)

This is a very simple and probably non-efficient implementation of KD-Trees for PHP. At the moment this mostly just a proof of concept. It's slightly buggy and needs some more tests written for it. Later I plan on either making this faster or producing a fast (and probably ugly) version for production usage. In the meantine if you require a speedy implementation I strongly suggest using an another language for this (node.js, C/C++, Go).

Pull Requests are more than welcome

For a road map please see the issues tracker.

Now uses a bounded SPL priority queue for results making things daftly faster when returning large result sets for nearest neigbour searches

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

[](#installation)

As this is the 21st century please use Composer to install this

```
composer install sandfox/kdtree
```

or create a composer.json file and run the composer install command to install it:

```
{
    "require": {
        "sandfox/kdtree": "~1.0"
    }
}
```

Usage
-----

[](#usage)

TO DO

Developmet
----------

[](#developmet)

Tests
-----

[](#tests)

To run the tests

```
make test
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

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 ~315 days

Total

3

Last Release

4404d ago

PHP version history (2 changes)0.0.1PHP &gt;5.4.0

0.1.0PHP &gt;=5.3.3

### Community

Maintainers

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

---

Tags

geospatialkdtreebsp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sandfox-kdtree/health.svg)

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

###  Alternatives

[jmikola/geojson

GeoJSON implementation for PHP

3069.4M85](/packages/jmikola-geojson)[phpmyadmin/shapefile

ESRI ShapeFile library for PHP

281.5M1](/packages/phpmyadmin-shapefile)[markbaker/quadtrees

QuadTree implementation in PHP

1739.9k](/packages/markbaker-quadtrees)[ricklab/location

A library of PHP objects for spatial calculations

1634.6k](/packages/ricklab-location)[foysal50x/h3-php

PHP FFI bindings for Uber's H3 hexagonal hierarchical geospatial indexing system

133.1k](/packages/foysal50x-h3-php)

PHPackages © 2026

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