You know you've got some cool APIs when Rasmus takes the time to write some code against them and then show the world how easy it is: GeoCool!

Web 2.0 and the programmable web that I and others have been talking about for a while has mostly been vapourware so far. There are a few generic components that are useful, but it is somewhat limited what you can do with them. And yes, you may consider this a somewhat biased view, but I think Yahoo!'s new geocoding platform is a huge step in the right direction.
There is of course the fancy new maps.yahoo.com/beta site which is fun, but as far as I am concerned the killer app here is the geocoding platform that drives this. And it is completely accessible for anyone to use. It's also a sane API that anybody can figure out in minutes. Here are a few tips for using this API from PHP 5.

I get the feeling he'll be adding that as an example to a PHP talk sometime soon... :-)

Posted by jzawodn at November 03, 2005 08:25 PM

Reader Comments
# Ravi Dronamraju said:

Jeremy,

I made a quick wordpress plugin that lets users tag their posts with a location. I guess it's fits in with the theme of PHP integration with GeoCoder API

on November 3, 2005 10:39 PM
# Pierre said:

Damn, the API is for the US only?

When is the coverage planned for the rest of us?

Cheers.

on November 4, 2005 12:26 AM
# Rasmus said:

It's not US-only. Canada works as well. Just not with Canadian postal codes. See this, for example:

http://lerdorf.com/php/ymap/geo4.php?location=1%20Yonge%20St,Toronto

If you expand the A marker there you can see it got the long/lat and filled in the state/province and country information correctly.

Also, if you look at the earthquake demo you can see that the quakes in the Fiji islands and other places "off the map" are put in the right relative place, it just doesn't have the graphics to go with it. I'd take that as a pretty good indicator that the coverage is going to grow significantly in the next couple of months.

on November 4, 2005 12:52 AM
# Jeff Dalton said:

I would love to see Europe / UK as the next market for the maps. I'm planning a wedding and I just created a site for the wedding in PHP.

I have got to say, I love the APIs for both Google and Yahoo maps. I'll have to try them out and see which is easier to use from PHP. I hadn't seen the new Yahoo maps beta and I've got to say -- it's definitely way cool. The small zoom pane is pretty sweet -- reminds me of NASA worldwind or Google Earth. Very nice innovation and integration with local results. The find on the map is really nice!

One request, what about a "reset" button on the small movement pane. I got lost in europe somewhere once and it too me a while to find my way home. A reset button would've been useful!

on November 4, 2005 05:49 AM
# Kathy said:

Can you tell me how to get my pictures to show when I pull up my Yahoo account. Also, when I forward an email my pictues will not show. I've emailed Yahoo and got no response.

Thanks you in advance.

on November 4, 2005 07:45 AM
# Rasmus said:

Jeff, note that as you scroll around a map (at maps.yahoo.com, not my simple demos) the URL changes and the back button works to undo these scrolls. Not quite a reset, but think of them breadcrumbs that will help you find your way back out of the dark forest.

on November 4, 2005 08:47 AM
# Jacques Marneweck said:

Rasmus,

I don't think Cape Town is in the USA:

Array
(
[precision] => city
[Latitude] => 40.467621
[Longitude] => -124.364594
[City] => CAPETOWN
[State] => CA
[Country] => US
)

Any idea when entring address with the country will work?

on November 4, 2005 01:25 PM
# Rasmus said:

There is actually a Capetown in California. And no, I don't have timelines for you for when the international support will improve. I can tell you that it will though.

on November 4, 2005 02:40 PM
# Greg said:

Wow, yet another example of Yahoo blatantly and shamelessly copying Google. Still, it's nice to have an alternative, and Yahoo has added a few nice touches. Hopefully Yahoo's isn't limited to a single URL like Google's is.

on November 4, 2005 03:59 PM
# Andrew Bidochko said:

As a response for GeoCool scripts Iíve created Geo!Suggest (http://mapbuilder.net/demo/yahoo.geocode.php) - AJAX interface for geocoding and handling multiple results received from Yahoo Geocoder. Right now source code is available upon request, but I will publish it soon.

on November 7, 2005 05:54 AM
# Andrew Bidochko said:

Geo!Suggest link is http://mapbuilder.net/demo/yahoo.geocode.php

For some reason link in the previous post was generated with mistake - trailing ")" was included to the link :(

on November 7, 2005 06:28 AM
# Philip K Kuruvilla said:

Rasmus,
I tried your example on this page for Geocoding addresses in Canada (1 Younge st., Toronto). That particular address worked but a lot of others returned a city level precision (as against an address level one). I have convinced myself that its something with the formatting of the address field. I tried these combinations of addresses:

1 Yonge Street Toronto ON
1 Yonge Street Toronto, ON
1 Yonge Street, Toronto, ON
1 Yonge Street,Toronto, ON
1 Younge st., Toronto, ON
1 Younge st, Toronto, ON
1 Younge st.,Toronto, ON

Atleast one of them would fail each time and the address that fails, kept changing each time. Now, I realize it's still in Beta but is there a "preferred" address format for Yahoo! Web services. It would make life a lot easier for me if I knew this. Ofcourse, I could be totally off track here (For all I know, it could be because, I repeatedly kept trying the same address :-) ). So, I thought I'd ask you if you've had similar feedback from any of the other users and if there was a workaround while the service was still in Beta. This seems to happen only with Canadian addresses.
Otherwise, the API and the new interface totally rocks! Way ahead of Brand-X . I especially like the multiple routing feature. If I can get my glitch figured out, I'm hoping to incorporate this webservice into my research project. Thanks

on March 14, 2006 07:23 PM
# Jeff said:

"Wow, yet another example of Yahoo blatantly and shamelessly copying Google."

Dude - c'mon. Google is just a yahoo clone that has done a better job as an ad sales platform. Neither Yahoo nor Google
do a great job on search, so it is tough to tell which is better.

No, I don't work for either joint.

on August 17, 2007 08:51 AM
# Anand sharma said:

Hii to All,,

Actually i went through the GeeCool API.But when i want to run the script on my local server its giving error like:

Fatal error: Call to undefined function yahoo_geo() in /var/www/html/php/anandkumar/Desktop/geo1.php on line 12

suggestions are welcome. :)

on February 20, 2008 02:13 AM
# Hospital Doctors Queensland said:

I have just tried this API and after a little hard work, I am able to run it correctly. By The Way, can some one let me know why is it geographically limited to certain countries only?

on April 5, 2010 02:18 AM
# Hospital Doctors Queensland said:

By The Way, thanks for your helpful post. Can you please let us know about some other similar APIs?
-----------------------------------
http://http://hospitaldoctorsqueensland.com.au

on April 5, 2010 02:20 AM
# ajmal said:

I think this API is really cool and worth trying. Being a professional php coder, I always look for new API's and then try each of them.
http://medicallocums.com.au

on May 1, 2010 11:05 PM
Disclaimer: The opinions expressed here are mine and mine alone. My current, past, or previous employers are not responsible for what I write here, the comments left by others, or the photos I may share. If you have questions, please contact me. Also, I am not a journalist or reporter. Don't "pitch" me.

 

Privacy: I do not share or publish the email addresses or IP addresses of anyone posting a comment here without consent. However, I do reserve the right to remove comments that are spammy, off-topic, or otherwise unsuitable based on my comment policy. In a few cases, I may leave spammy comments but remove any URLs they contain.