All Projects → jeroendesloovere → geolocation-php-api

jeroendesloovere / geolocation-php-api

Licence: MIT License
This Geolocation PHP class connects to Google Maps API to find latitude/longitude or the address.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to geolocation-php-api

pikaz-location
定位插件(限中国)
Stars: ✭ 78 (+9.86%)
Mutual labels:  geolocation, latitude, longitude
Seeker
Accurately Locate Smartphones using Social Engineering
Stars: ✭ 2,772 (+3804.23%)
Mutual labels:  geolocation, latitude, longitude
laravel-geoly
Perform fast and efficient radius searches on your Laravel Eloquent models.
Stars: ✭ 25 (-64.79%)
Mutual labels:  geolocation, latitude, longitude
php-haversine-formula
Calculates de distance between two geocode points 📌🗺
Stars: ✭ 44 (-38.03%)
Mutual labels:  latitude, longitude
react-cartographer
Generic component for displaying Yahoo / Google / Bing maps.
Stars: ✭ 82 (+15.49%)
Mutual labels:  latitude, longitude
Open Location Code
Open Location Code is a library to generate short codes, called "plus codes", that can be used as digital addresses where street addresses don't exist.
Stars: ✭ 3,567 (+4923.94%)
Mutual labels:  latitude, longitude
geodesy-php
Geodesy PHP - Port of some known geodesic/math functions for getting distance from a known point A to a known point B given their coordinates. It also supports conversion between units of length, Polar position to Cartesian coordinates, and different Reference Datums.
Stars: ✭ 26 (-63.38%)
Mutual labels:  latitude, longitude
ctt
ctt postal codes into MySQL with latitude and longitude from google
Stars: ✭ 33 (-53.52%)
Mutual labels:  latitude, longitude
beihu-geo
地理位置解析服务,可供爬虫使用!供参考学习!
Stars: ✭ 16 (-77.46%)
Mutual labels:  latitude, longitude
Trilateration
Trilateration system using 3 latitude and longitude points, and 3 radius distances in PHP, C#, Java and Javascript
Stars: ✭ 22 (-69.01%)
Mutual labels:  latitude, longitude
orange3-geo
🍊 🌍 Orange add-on for dealing with geography and geo-location
Stars: ✭ 22 (-69.01%)
Mutual labels:  geolocation, latitude
haversine-js
JavaScript implementation of the Haversine formula
Stars: ✭ 12 (-83.1%)
Mutual labels:  latitude, longitude
Solar-Calculator
Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.
Stars: ✭ 36 (-49.3%)
Mutual labels:  latitude, longitude
Vincenty-Excel
Thaddeus Vincenty's Direct and Inverse formulae for geodesic calculations in Excel (distance, azimuth, latitude, longitude).
Stars: ✭ 29 (-59.15%)
Mutual labels:  latitude, longitude
llttz
The easy way to get java TimeZone from latitude/longitude
Stars: ✭ 27 (-61.97%)
Mutual labels:  latitude, longitude
Positional
An elegant and colorful location information app for Android with Compass, Clock, Level, Sun, Moon, Trail Marker and many other features.
Stars: ✭ 72 (+1.41%)
Mutual labels:  latitude, longitude
PHPCoord
PHPCoord is a PHP library to aid in handling coordinates. It can convert coordinates for a point from one system to another and also calculate distance between points
Stars: ✭ 78 (+9.86%)
Mutual labels:  latitude, longitude
react-hook-geolocation
A React hook to access data from the Geolocation API
Stars: ✭ 31 (-56.34%)
Mutual labels:  geolocation
Java-DB-IP
A Java wrapper for DB-IP free city database
Stars: ✭ 29 (-59.15%)
Mutual labels:  geolocation
crisis-news-mapper
日本の災害関連ニュースをTwitterから収集して地図上にマッピングするFirebaseプロジェクト crisis.yuiseki.net
Stars: ✭ 13 (-81.69%)
Mutual labels:  geolocation

Geolocation PHP class connects to Google MAPS API

Latest Stable Version License Build Status Scrutinizer Code Quality

This Geolocation PHP class connects to Google Maps API to find latitude/longitude or address.

Installing

Using Composer

When using Composer you can always load in the latest version.

composer require jeroendesloovere/geolocation-php-api

Check in Packagist.

Usage example

getCoordinates

Get latitude/longitude coordinates from address.

$street = 'Koningin Maria Hendrikaplein';
$streetNumber = '1';
$city = 'Gent';
$zip = '1';
$country = 'belgium';

$result = Geolocation::getCoordinates(
    $street,
    $streetNumber,
    $city,
    $zip,
    $country
);

getAddress

Get address from latitude/longitude coordinates.

$latitude = 51.0363935;
$longitude = 3.7121008;

$result = Geolocation::getAddress(
    $latitude,
    $longitude
);

Check the Geolocation class source.

Symfony bundle

I've also created a Symfony bundle. View the Geolocation bundle.

Tests

We have tests to make sure everything works as expected. First execute composer install. Then execute vendor/bin/phpunit tests.

Coding Syntax

We use squizlabs/php_codesniffer to maintain the code standards. Type the following to execute them:

# To view the code errors
vendor/bin/phpcs --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"

# OR to fix the code errors
vendor/bin/phpcbf --standard=psr2 --extensions=php --warning-severity=0 --report=full "src"

Read documentation about the code standards

Documentation

The class is well documented inline. If you use a decent IDE you'll see that each method is documented with PHPDoc.

Contributing

It would be great if you could help us improve this class. GitHub does a great job in managing collaboration by providing different tools, the only thing you need is a GitHub login.

  • Use Pull requests to add or update code
  • Issues for bug reporting or code discussions
  • Or regarding documentation and how-to's, check out Wiki More info on how to work with GitHub on help.github.com.

License

The module is licensed under MIT. In short, this license allows you to do everything as long as the copyright statement stays present.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].