markbaker/quadtrees
最新稳定版本:2.2.2
Composer 安装命令:
composer require markbaker/quadtrees
包简介
QuadTree implementation in PHP
README 文档
README
A PHP implementation of the QuadTree data structure
Requirements
- PHP version 7.0.0 or higher
Installation
We recommend installing this package with Composer.
Via composer
In your project root folder, execute
composer require markbaker/quadtrees:dev-master
You should now have the files composer.json and composer.lock as well as the directory vendor in your project directory.
You can then require the Composer autoloader from your code
require 'vendor/autoload.php';
Or, if you already have a composer.json file, then require this package in that file
"require": {
"markbaker/quadtrees": "dev-master"
}
and update composer.
composer update
From Phar
Although we strongly recommend using Composer, we also provide a Phar archive builder that will create a Phar file containing all of the library code.
The phar builder script is in the repository root folder, and can be run using
php buildPhar.php
To use the archive, just require it from your script:
require 'QuadTrees.phar';
Standard Autoloader
If you want to run the code without using composer's autoloader, and don't want to build the phar, then required the bootstrap.php file from the repository in your code, and this will enable the autoloader for the library.
require 'bootstrap.php';
Want to contribute?
Fork this library!
License
QuadTrees is licensed under an MIT LICENSE)
Examples
The /examples folder contains a couple of examples to demonstrate its use:
-
citySearch.php
allows a search on a defined bounding box, and will display a list of cities that fall within that bounding box
usage:
php citySearch.php <latitude> <longitude> <width> <height> latitude Latitude of the centre point of the bounding box (as a floating-point value in degrees, positive values for East, negative for West) longitude Longitude of the centre point of the bounding box (as a floating-point value in degrees, positive values for North, negative for South) width Width of the bounding box (as a floating-point value in degrees) height Height of the bounding box (as a floating-point value in degrees)
Data for the list of cities is from geonames.org, licensed under a Creative Commons Attribution 3.0 License, and provided "as is" without warranty or any representation of accuracy, timeliness or completeness.
-
lunarLandingSearch.php
allows a search on a defined bounding box, and will display a list of moon landings that fall within that bounding box
usage:
php lunarLandingSearch.php <latitude> <longitude> <width> <height> latitude Latitude of the centre point of the bounding box (as a floating-point value in degrees, positive values for East, negative for West) longitude Longitude of the centre point of the bounding box (as a floating-point value in degrees, positive values for North, negative for South) width Width of the bounding box (as a floating-point value in degrees) height Height of the bounding box (as a floating-point value in degrees)
统计信息
- 总下载量: 38.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-30