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

ActiveLibrary

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

A slow and possibly buggy implementation of a kdtree in php

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

Since Sep 10Pushed 11y 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 today

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 57% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity25

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

4310d 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

[mevdschee/php-crud-api

Single file PHP script that adds a REST API to a SQL database.

3.7k62.8k7](/packages/mevdschee-php-crud-api)[jmikola/geojson

GeoJSON implementation for PHP

3058.8M70](/packages/jmikola-geojson)[phpmyadmin/shapefile

ESRI ShapeFile library for PHP

281.4M1](/packages/phpmyadmin-shapefile)[hexogen/kdtree

file system KDTree index

2085.0k](/packages/hexogen-kdtree)[markbaker/quadtrees

QuadTree implementation in PHP

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

A library of PHP objects for spatial calculations

1532.5k](/packages/ricklab-location)

PHPackages © 2026

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