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-PHP
Informations about the package geo-location
GeoLocation for PHP
GeoLocation for PHP offers convenient and easy to use methods for geocoding, geolocation and geometry functions in PHP.
Features include:
- Retrieve bounding box coordinates. Just define a coordinate and the size of your bounding box.
- calculate distances between geopoints/coordinates
- Solve point in polygon problems (identify whether a given point is within the bounds of a polygon)
Examples
Get distance between two points:
Get latitude and longitude from address or location
In order to use this method, you'll need to register at Google Cloud Console and enable the Geocoding API
`
Get bounding box coordinates
How to find if coordinates/geopoint are in a polygon.
Transform bounding box coordinates into a polygon
and now you can check if the GeoPoint is the polygon / bounding box:
Running Tests
Run the following from the project directory:
Credits and Legal
This is a collection of PHP classes written by Anthony Martin. Some of GeoLocation.php was derived from Java code that was originally published at
http://JanMatuschek.de/LatitudeLongitudeBoundingCoordinates.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2019 Anthony Martin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.