Download the PHP package philiprehberger/php-geo without Composer
On this page you can find all versions of the php package philiprehberger/php-geo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download philiprehberger/php-geo
More information about philiprehberger/php-geo
Files in philiprehberger/php-geo
Download philiprehberger/php-geo
More information about philiprehberger/php-geo
Files in philiprehberger/php-geo
Vendor philiprehberger
Package php-geo
Short Description Geospatial utilities for distance, bounding box, and point-in-polygon calculations
License MIT
Homepage https://github.com/philiprehberger/php-geo
Package php-geo
Short Description Geospatial utilities for distance, bounding box, and point-in-polygon calculations
License MIT
Homepage https://github.com/philiprehberger/php-geo
Please rate this library. Is it a good library?
Informations about the package php-geo
PHP Geo
Geospatial utilities for distance, bounding box, and point-in-polygon calculations.
Requirements
- PHP 8.2+
Installation
Usage
Distance Calculation (Haversine)
Vincenty Distance
Bounding Box
Point in Polygon
Bearing
Midpoint
Destination
Compass Direction
Elevation
Polygon Area
Geohash Encoding/Decoding
Polyline Encoding/Decoding
Route Distance
Units
Supported units: km (kilometers), mi (miles), m (meters), nmi (nautical miles).
API
| Method | Description |
|---|---|
Geo::distance($a, $b, $unit) |
Haversine distance between two coordinates |
Geo::distanceVincenty($a, $b, $unit) |
Vincenty distance between two coordinates |
Geo::boundingBox($center, $radius, $unit) |
Bounding box around a center point |
Geo::contains($polygon, $point) |
Point-in-polygon test (ray casting) |
Geo::bearing($from, $to) |
Initial bearing in degrees |
Geo::midpoint($a, $b) |
Geographic midpoint |
Geo::destination($start, $bearing, $distance, $unit) |
Destination from start given bearing and distance |
Geo::compassDirection($bearing) |
Convert bearing to cardinal/intercardinal direction |
Geo::area($polygon) |
Polygon area in square meters (Shoelace formula) |
Geo::encodeGeohash($coord, $precision) |
Encode coordinate to geohash string |
Geo::decodeGeohash($hash) |
Decode geohash to coordinate (center of cell) |
Geo::geohashBounds($hash) |
Get bounding box of a geohash cell |
Geo::encodePolyline($coordinates) |
Encode coordinates to Google polyline string |
Geo::decodePolyline($encoded) |
Decode Google polyline string to coordinates |
Geo::routeDistance($coordinates, $unit) |
Total distance along a multi-point route |
Coordinate::withElevation($meters) |
Return new Coordinate with elevation |
Coordinate::getElevation() |
Get elevation in meters or null |
Development
Support
If you find this project useful:
License
MIT
All versions of php-geo with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
The package philiprehberger/php-geo contains the following files
Loading the files please wait ...