How To Get Forward Geocoding in iPhone MapKit

How To Get Forward Geocoding in iPhone MapKit

The CoreLocation and MapKit sessions at WWDC yesterday gave an insight to some of the powerful technology that the iPhone OS 3.0 and iPhone 3G S will bring to application developers. The new compass and enhanced accelerometer support that the combination of new hardware and software bring were a big hit with the WWDC crowd. The incomplete feature sets around MapKit were less of a hit.

MapKit seeks to be a very well implemented iPhone mapping library, that lets developers add Google maps to their iPhone applications as well as perform reverse geocoding. Sadly for iPhone developers, the fun stops with reverse geocoding. Forward geocoding (the process of turning an address into a latitude and longitude) is not available in MapKit. The reasons for this lie in complex licensing agreements between Apple, Google and TomTom (who own all of the map data that Google and Apple use). CloudMade will help you avoid the complexity.

iPhone Developers at WWDC were urged to use external geocoding services by the iPhone engineering team. CloudMade’s geocoding service fits the bill perfectly. iPhone developers can integrate CloudMade’s geocoding web-services directly into their MapKit applications, without worrying about breaking and terms of service. The geocoding web service looks like this:

http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/
geocoding/find/moscone center west.html

Lets take a closer look at the URL:

http://geocoding.cloudmade.com/ – the base URL

BC9A493B41014CAABB98F0471D759707/ – your API key, available here

geocoding/find – the “find” method, more docs here

moscone center west – the text string to search for

.html choose from HTML or JSON output.

Click here to see the result.

You can find our more about CloudMade’s geocoding services here.

How To Get Forward Geocoding in iPhone MapKit

June 12th, 2009 - Posted by Nick Black in REST, Uncategorized, api, developers, iPhone, products | | 8 Comments

8 Responses to ' How To Get Forward Geocoding in iPhone MapKit '

Subscribe to comments with RSS or TrackBack to ' How To Get Forward Geocoding in iPhone MapKit '.

  1. CT said,

    on June 12th, 2009 at 5:50 pm

    The result is actually:
    Server Error 404
    Please check.

  2. marc tobias said,

    on June 12th, 2009 at 11:14 pm

    ( There is a small typo at the end of the “Click here to see the result.” URL )

  3. Andy Allan said,

    on June 15th, 2009 at 10:33 am

    CT, mtm – thanks guys, that’s fixed up now.

  4. Juan Pablo Garcia said,

    on July 9th, 2009 at 7:32 pm

    Hi, Can I use this service for locations in Argentina? Because I am trying to use this service to find a street located in Buenos Aires, Argentina but i’m not beeing able to find it.

    I am using this query http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/find/2344,Malabia,capital%20federal,Buenos%20Aires,Argentina.html?results=1

    Thanks!

  5. nick said,

    on July 11th, 2009 at 1:03 pm

    Hi there Juan. Try using the “Find_structured” API method, like this:

    http://geocoding.cloudmade.com:80/BC9A493B41014CAABB98F0471D759707/geocoding/find_structured/street:malabia.html?return_location=true&active_page=0&results_number=10

    We’re going to be updating the whole geocoding service in the next few days with faster query times and a re-structured API that will make queries like this much easier.


  6. on July 14th, 2009 at 5:13 pm

    Nick, thanks for your response. The problem that i have is with the street number. I am beeing able to locate the whole street but i am not beeing able to locate the single point with street and street number. My question is if the URL that i am using is correct to find a point with street and street number.

    Many Thanks!
    Juan Pablo Garcia

  7. pawpaw17 said,

    on October 6th, 2009 at 6:43 pm

    Yes, but for general purpose geocoding, cloudmade is not ready for prime time. Common tasks like “geocode zipcode x” are not production quality, in the US at least.

    Has anyone gone down a different path with forward geocoding on iPhone? Is anyone using Google Maps API? There are some examples in iPhone programming books, but they fail to address the fact that google maps API license keys are tied to domains.

    Any ideas would be appreciated.

    Thanks

  8. faisal said,

    on October 10th, 2009 at 5:31 am

    how i get the value of latitude and longitude in my xcode project.
    as i am not much familiar with json.

Leave a reply