Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drwpow/php_geocoder

Basic Google Geocoding API for PHP
https://github.com/drwpow/php_geocoder

Last synced: 9 days ago
JSON representation

Basic Google Geocoding API for PHP

Awesome Lists containing this project

README

        

# PHP Geocoder

A simple function that passes a request to the Google Geocoding API and returns an object formatted for PHP.
In case that fails, it falls back to Yahoo!’s API.
Can be used to gather latitude/longitude coordinates for any given address/pseudo-address (or best guess),
as well as supply missing information (eg, Zip Codes) for any given partial address.

## Notes:
Mostly used to take any input and turn into a lat/lng coordinate.
For that reason, a PHP object is returned with "lat" and "lng".
To return the entire object, set $coordonly to FALSE.

Uses the Google Geocoding API (2500 requests / day), but if that fails, it
falls back to Yahoo! (50,000 / day).

$latLng and $bounds are used only by Google's Geocoding API. For more
information on that, refer to the documentation on "Viewport Biasing."

For more information, see Google's documentation here: https://developers.google.com/maps/documentation/geocoding/
and Yahoo's documentation here: http://developer.yahoo.com/geo/placefinder/guide/index.html