Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
Where are you? Implementing geolocation with Geocoder PHP
Oct 23, 2014 @ 16:45:17

The SitePoint PHP blog has a new tutorial posted by Arno Slatius showing you how to use geocoding in PHP to find the latitude and longitude of a point given its address or name. He makes use of the geocoder-php library to make things a bit simpler.

The beauty of SitePoint, to me, is that you can get inspired to try something or be told about some cool project out there. The internet is simply too big for one person to scout out on their own. Geocoder was one of those for me. I had never heard about it and came across it on the authors Trello board. I love working with maps and geographic information and I use (reverse) geocoding heavily for a project I did for a client; CableTracks. [...] I found out that Geocoder PHP actually is what I was missing for the integration of various services that we use.

He starts by helping you get the library installed (either via Composer or manually) and the creation of a simple Google Maps goecode request for a location. He includes an example of the results and mentions how the library handles locales in both the input and output. He also shows how the tool lets you do reverse geocoding - given a latitude and longitude, it can provide you address and location information. It also includes lookup support for IP addresses and output formatting and examples using both are also included.

tagged: geolocation geocoder tutorial library introduction geocoderphp

Link: http://www.sitepoint.com/implementing-geolocation-geocoder-php/


Trending Topics: