Download the PHP package frostybee/geobee without Composer
On this page you can find all versions of the php package frostybee/geobee. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frostybee/geobee
More information about frostybee/geobee
Files in frostybee/geobee
Package geobee
Short Description A simple, stand-alone PHP library for calculating the distance between geographical coordinates.
License MIT
Homepage https://github.com/frostybee/geobee
Informations about the package geobee
Geobee
A standalone PHP library for calculating the distance between geographical coordinates.
Installation
This library requires no dependencies.
To install it:
- Clone this repository.
- Or use composer:
composer require frostybee/geobee
Units of Lengths
The following are the supported units of lengths along with their respective conversion factors:
m
- Meters (default)km
- kilometers (1km = 1000 meters)mi
- Miles (1mi = 1609.344 meters)nm
- Nautical miles (1nm = 1852 meters)yd
- Yards (1yd = 0.9144)ft
- Feet (1ft = 0.3048 meters)
Usage
Using this library is simple and straightforward. Just instantiate the Calculator
class and supply two pairs of latitude/longitude to the calculate()
method as shown below.
Converting the Distance from Meters to other Units
Single Conversion
Use the to()
method as show below. However, you must call the calculate()
method once before doing any conversions.
Or:
Multiple Conversions
- Use the
toMany()
method to convert the distance from meters to many (one or more) units of lengths:
The above call returns an associative array structured as follows:
- Convert to all supported length units.
output: