News Feed
Sections




News Archive
feed this:

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
October 23, 2014 @ 11: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.

0 comments voice your opinion now!
geolocation geocoder tutorial library introduction geocoderphp

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

Paul Reinheimer:
Using GeoIP at WonderProxy
November 07, 2013 @ 10:57:09

Paul Reinheimer has a new post talking about some of his experience implementing GeoIP at his HTTP testing proxy service WonderProxy (and the steps you'd need to take to make it work for your application). The GeoIP service helps you identify the sources (geolocation) of connections to your applications.

At WonderProxy we've been helping people test their GeoIP sensitive applications since launch. It's why we launched. Perhaps ironically it's never been a technology we've used on our own website. With our upcoming re-design that's changing.

He's broken it down into four major steps, each with a bit of description to go along with them:

  • Using GeoIP
  • Acquire a database
  • Rebuild Apache & PHP (with the Apache module)
  • Handle edge cases

This isn't a detailed tutorial to getting GeoIP support working in your app, but it does provide a good direction and links to several resources to help you along your way.

0 comments voice your opinion now!
geoip geolocation wonderproxy overview tutorial database

Link: http://blog.preinheimer.com/index.php?/archives/421-Using-GeoIP-at-WonderProxy.html

Etsy Code as Craft:
There and Back Again Migrating Geolocation Data to GeoNames
April 01, 2013 @ 11:48:36

On the Etsy "Code as Craft" blog there's a recent post about their move to using the GeoNames service internally rather than the external, third-party API previously in use.

People are passionate about where they live. At Etsy we need to keep track of lots of different locations, such as buyers' billing and shipping addresses and sellers' shop locations. As Etsy continues to expand internationally we wanted to provide better localization and translations for our location place names. We determined that the best way to effect this change was to move from using a closed location API provider to internal services backed by the open GeoNames data set.

The post details some of the steps in the process including the mapping of the current data to the new structure (the script is available on github). They talk about how they mapped their old data over (trial and error sometimes) and the creation of a database of "GeoNameIDs" for each customer in their records. They've also implemented a Lucene/Solr search for improved searching and auto-suggestion based on the user's location.

0 comments voice your opinion now!
data migration geonames geolocation api script


PPI Framework Blog:
Tutorial GeoLocation with FourSquare and Google Maps
January 28, 2013 @ 13:06:28

On the PPI framework blog there's a recent post showing how to use the framework to create geolocation functionality via an interface with FourSquare and Google Maps.

In this article, we're going to learn how to work with the framework as a whole by writing a real-world application: making a module, controller, routes, templates (views) and services. In order to achieve this we are will use the Foursquare API, and APC for caching the API lookups. We will plot venues from Foursquare in Google Maps for display.

They help you set up a skeleton application and start on creating the "Foursquare Module" along with its controller and views. There's Javascript code included to use the Google Maps functionality and a simple class to work with the FourSquare API to get nearby venues. In the end, you'll have a basic application that maps out the points automatically.

0 comments voice your opinion now!
geolocation foursquare googlemaps tutorial ppiframework


Sherif Ramadan:
Web Analytics with PHP and Google Visualization Made Simple
December 19, 2012 @ 12:38:47

in this new post to his site Sherif Ramadan shares a method for visualizing your website's visitor data with the help of the Google Visualization APIs and some geolocation.

The web is a place where everyone is in your backyard. This can be both a blessing and a curse. How do you know where your website traffic is coming from and how much of it there is? [...] How was traffic led to your website in the first place and why? How long do people stick around and what do they like the most about your site? These are all some of the many questions you can answer with web analytic software, but the real question is why would you want to answer these questions at all and what's the best way to look at the answer?

[...] If we look at a heat map it's easier to spot where the majority of our visitors and traffic are coming from, geographically. It also helps us understand that people visiting a virtual space can, and will, be physically located in different parts of the world.

He includes the steps to recreate a map like the one included in this page showing the current view statistics on his site. He uses a MySQL backend to store the GeoIP data and parses out the Apache "access_log" to get the IPs of the visiting users. He then runs these against the GeoIP data and passes this country data on to Google's visualization for handling. He also recommends using the tools offered by the Google Webmaster Tools to further enhance your introspection into your site's visitors.

0 comments voice your opinion now!
google analytics geolocation analytics visualization country


Chris Risner:
Mobile Geolocation Apps with Windows Azure Websites Part 1 The PHP Code
September 19, 2012 @ 08:14:46

Chris Risner has posted the first part of his series looking at mobile geolocation in PHP-based Azure applications as hosted on the Windows Azure service.

The first article in this mini-series on creating geolocation apps with the backend hosted in Windows Azure Websites is going to be a walkthrough of the PHP code that we'll host in Windows Azure. The PHP site will be simple and expose just a few methods. Prior to getting into the code for the service, we need to setup a new website in Windows Azure and set up our database.

He walks you through some of the initial steps to create the PHP side of things - setting up the website instance and database, downloading the Silex PHP framework and the PHP code to get process the latitude and longitude of the current user. Also included is code to help find "interesting" points near the user and code to allow the user to add their own.

0 comments voice your opinion now!
tutorial windowsazure azure geolocation mysql silex latitude longitude


PHPMaster.com:
Where on Earth are You?
February 02, 2012 @ 08:52:54

In PHPMaster.com's latest tutorial Lukas White introduces you to using the Yahoo "Placemaker" web service to geographically locate a place from a free-form text string. The results include "place details" like the type of the location, latitude, longitude and how confident they are in their match.

The challenge then is to do two things: work out what place you could be talking about, disambiguate if necessary, and then identify exactly where on Earth that is. That's what I'll show you how to do in this article; by using a freely available web service, we'll write a simple program to ask users where they are (and ask them to clarify if necessary) before identifying their responses in concrete terms.

He shows how to make a request to the Placemaker web service, passing it a string coming from the user, to be located. The POST request contains a few pieces of data including an application ID , your desired output type and the language you're using for the input. His example code uses curl to make the request and handles it (the XML response at least) with a call to simplexml_load_string.

0 comments voice your opinion now!
where geolocation yahoo placemaker webservice api tutorial


PHPMaster.com:
Targeted Geolocation with Geonames
December 13, 2011 @ 12:10:02

New on PHPMaster.com there's a tutorial from Lukas White about targeting users using geolocation based on the Geonames web service and a latitude/longitude. His example makes a call to find the closest "place" to the given coordinates.

Location-aware applications rely on being able to locate where you are, and this is what geolocation is all about. After all, once the application knows your location, it can go on to find the nearest store, guide you through the appropriate route to a destination, or target relevant advertisements to you. Geolocation, then, is simply the mechanism for identifying your geographical location.

He mentions two challenges associated with geolocation - finding where someone is and describing the location. With Geonames, he shows how to call the service's "findNearbyPlaceName" method to find the closest "place" to a given latitude/longitude combination. Included is a bit of sample PHP to connect to the service and Javascript to request the user's current location.

0 comments voice your opinion now!
geolocation tutorial geonames webservice json location


Derick Rethans' Blog:
Using OpenStreetMap tiles with Flickr
March 01, 2011 @ 09:37:56

Derick Rethans has a new post today with a bit of code showing how to combine Flickr and OpenStreetMap and make a mapping tool that plots out the location information for the Flickr images.

I like taking pictures, and I usually take a GPS so that I can place them on a map on my Flickr page. On my last excursion however, the battery of my GPS had died, so I did not have location information available to store in my pictures' EXIF headers. Flickr can use the EXIF headers to then show the images on the map. Because I did not have the location information to automatically place my pictures on the map, I wanted to do that by hand.

His script (as used by a local Squid proxy) supports two different versions of the mapping - one for Yahoo! Maps and the other for OpenStreetMaps'. You can see the end result here - a set of Flickr images with a map in the background.

0 comments voice your opinion now!
tutorial flickr geolocation openstreetmap squid proxy


Timothy Boronczyk's Blog:
Geolocation Search
January 28, 2011 @ 11:49:49

In a post earlier this month Timothy Boronczyk took a look at a common feature for web applications that's popping up more and more given the emphasis of social networking - geolocation of your users. The post shows you how to use various web services and data sets to determine where a user is and how they relate to other locations.

Services that allow users to identify nearby points of interest continue to grow in popularity. I'm sure we're all familiar with social websites that let you search for the profiles of people near a postal code, or mobile applications that use geolocation to identify Thai restaurants within walking distance. [...] The first step is to obtain the latitude and longitude coordinates of any locations you want to make searchable.

He talks about why postal code-based location isn't the best option, a web service (like Geocoder.ca for Canadians) could provide more accurate results. He includes code you can use to help search the data based off of two formulas - one to grab the larger area of locations and the other to filter them down into the closest. Finally, he shows how to use the Geolocation API service to get the results based on the user's search parameters.

0 comments voice your opinion now!
tutorial geolocation search forumla webservice postalcode



Community Events





Don't see your event here?
Let us know!


laravel library tips introduction unittest deployment update api community zendserver install podcast series symfony framework interview package opinion release language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework