We started working a little bit with location-based services. One of the tasks was to create a webservice endpoint to serve placemark information for a certain location. We chose Google's KML (Keyhole Markup Language) as the representation format. It has become an official Open Geospatial Consortium (OGC) standard.
This piece of code might be useful for those who have a similar need to serialize placemark objects in to KML. It is using PHP's Document Object Model (DOM) extension.
n the first part of this series I showed how you could get the country of a visitor via his IP address. Now with this precious information, I'll show you how to map the visitor visually on the world map using Google Maps.
In this short post I'll show you how to geolocate your visitors with PHP. First of all let's have a look at what you'll need :
* PEAR GeoIP
* MaxMind GeoLite Country
In this tutorial, we'll take a look at the technique of geotargeting, or serving content to users based on their physical location. The technology is invaluable; with simple techniques, you can target advertising to specific users, collect more accurate usage statistics, serve content in different languages for different regions and provide local information like weather reports to your visitors. I'll briefly cover what you need to know about geoip, and then move on to some code samples of how to achieve it with the Maxmind database, using both the standard PHP library and the PEAR version.
The previous installment of this ongoing series covering the Google Maps API (Part 1, Part 2, Part 3, Part 4, Part 5), I introduced the API's new geocoding feature, released this past June 11. In this tutorial I showed you how to submit geocoding requests via JavaScript, which is convenient because it's easy to subsequently build a map using the retrieved coordinates. However, if you're interested in performing bulk geocoding for reason of storing a series of coordinates in a database, you might be interested in taking advantage of a second means for geocoding, accomplished by way of HTTP request. Storing the coordinates locally will not only decrease the number of required daily geocoding requests (limited to 50,000 daily), but it will speed your application by cutting down on the total requests required to ultimately build a map.
In this article I'll show you how to use the HTTP request method in conjunction with PHP, culminating with an example involving the geocoding of numerous addresses for storage in a MySQL database.
Ever wondered how sites like Google and Yahoo! always seem to know which country you're in, and automatically redirect you to the most appropriate country sub-site? Or how some Web sites display advertisements perfectly targeted to your city or region? Well, it isn't magic -- these sites are simply mapping your IP address to a geographical database to identify your location, and then using this information to send you precisely-targeted data.
The coolest thing about this, though, isn't the technology. It's the fact that even small Web site owners and developers can access and use this technology, if they know a little PHP and HTML. And that's where this brief article comes in. I will introduce you to some simple tools that you can use to set up geo-location on your own Web site.
I’m actually going to write about the latest project I’ve been working on. The project is called Geovisitor. In short, a user copies a little piece of HTML code into their website or blog and they can instantly start tracking where their hits are coming from. The website uses an free external website called hostip.info to extract the location from the incoming ip address. The HTML code creates a small hyperlink image which directs the user to the main Geovisitor page displaying their geolocated hits on a google map.
This is part 2 of the "Note on implementing location based search" article. If you haven’t read part 1 yet, go do it now. We got geocoding out of the way in the first part, so now it’s time to talk distances. To figure out how far apart two places are, we could use the traditional method of calculating distances between two points, but that damn Columbus didn’t fall off into the Twighlight Zone when he passed the horizon. Turns out the Earth isn’t flat, go figure [1]. Oh, and since it isn’t flat, assuming that it is will cause your numbers to be off when calculating distances using normal geometry—sometimes by miles. To complicate things even more, the Earth isn’t even a sphere. The force it generates spinning actually causes it to bulge near the horizon, making it an oblate spheroid. This bulge isn’t huge, so (for most purposes) assuming the Earth is a sphere is good enough.
We’re going to be adding location based searching to OC Food Review soon, so I figured I’ll explain how we do it before it comes out. It took me a good amount of Google searching and reading to get all the details ironed out, so hopefully this will save someone some time. It’s a fairly lengthy topic, so I’ll break it up into parts to make it more manageable. Two parts should do the trick. Today I’ll do a short overview, and talk about geocoding with Yahoo’s Map API. Tomorrow, I’ll talk about distance calculations and doing the actual search. Let’s get this party—err…part started.
In the last installment, "Integrating Google Maps Into Your Web Applications", you learned how to take advantage of Google's amazingly convenient mapping API. In this tutorial, I mentioned the API doesn't yet offer a means for translating addresses to latitudinal and longitudinal coordinates. Because these coordinates are required to display locations and plot points, information about two third-party solutions capable of doing so was provided: doing so through the geocoder.us website or by creating your own data repository using the Perl module Geo::Coder::US and the freely available U.S. Census Bureau TIGER/Line data. Because the reader response to this most recent article was considerable, I've decided to continue the discussion by showing you how to retrieve these coordinates using the geocoder.us Web services and PHP scripting language. In the next installment, I'll introduce the second solution requiring the Geo::Coder::US module.








News von