Download the PHP package anthonymartin/geo-location without Composer
On this page you can find all versions of the php package anthonymartin/geo-location. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download anthonymartin/geo-location
More information about anthonymartin/geo-location
Files in anthonymartin/geo-location
Package geo-location
Short Description Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP
License MIT
Homepage https://github.com/anthonymartin/GeoLocation
Informations about the package geo-location
GeoLocation for PHP
Typed, immutable geographic points and polygons for PHP 8.3+: distances, regions, ellipsoidal geodesics, SQL proximity filters, GeoJSON/WKT, geohashes and geocoding. Geometry is pure PHP, with no runtime Composer dependencies or optional extensions.
2.x remains supported as-is, including PHP 5.4, with security and bug fixes
and no scheduled end-of-support date. ^2.0 stays on 2.x. Moving to 3.0 is optional;
read the migration guide before changing your constraint.
Five examples
Save each example in your application's root directory, beside vendor/.
Coordinates are latitude, longitude in degrees. Units are explicit: km,
kilometers, mi or miles, case-insensitively. Numeric coordinate strings are
accepted; getters return floats. Invalid or non-finite coordinates throw.
Distance and immutable coordinates
Bearings and destinations
Bounding boxes
Circles and regions
Polygons
Point distances use a sphere. Boxes and circles include their boundaries; boxes
handle the antimeridian. Polygon contains() is planar with half-open boundaries.
Use containsSpherical() explicitly for minor great-circle rings crossing the date
line or enclosing a pole. See the guides for geometric limits and accuracy.
Guides
| Feature | Guide |
|---|---|
| Coordinates, immutable polygons, area, centroid, simplification, validation | Geometry |
| Bounding boxes, circles, interchangeable region contracts | Regions |
| Bearings, interpolation, WGS-84 Vincenty solver and accuracy limits | Geodesy |
| Parameterized MySQL, PostgreSQL and SQLite proximity queries | SQL |
| GeoJSON and WKT codecs, coordinate order and unsupported shapes | Formats |
| Google, Nominatim, reverse geocoding, PSR-18 HTTP and test doubles | Geocoding |
| Encoding, neighbors and bounded region coverage | Geohashes |
| Reproducible measurements | Benchmarks |
Geocoding uses native cURL or an injected PSR-18 client. Credentials, provider policies, caching and rate limits are described in the geocoding guide.
Contributors: read Development. CI runs PHP 8.3–8.5, the documentation examples, PHPStan max and dependency/purity checks. See CHANGELOG.md for release history.
MIT licensed; see LICENSE. Created by Anthony Martin. Some original geometry code derives from Jan Philip Matuschek's bounding-coordinate work.