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 1mo 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 54% 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

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

[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[mevdschee/php-crud-api

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

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

GeoJSON implementation for PHP

3109.0M77](/packages/jmikola-geojson)[phpmyadmin/shapefile

ESRI ShapeFile library for PHP

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

file system KDTree index

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

QuadTree implementation in PHP

1739.2k](/packages/markbaker-quadtrees)

PHPackages © 2026

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