views:

3208

answers:

3

I am perplexed as to why there is an iPhone API for Reverse Geocoding (lat/long to address) but NOT for regular Geocoding (address to lat/long).

I want to be able to display an annotation on a map (MKMapView) at an address entered by the user. (As text, not by touching the map) As far as I can tell, that means I have to determine the lat/long for the entered address.

It looks like it can be done using HTTP, but then, Reverse Geocoding ALSO could have been done that way, too. Why did they support one but not the other?

Answers as to "why?" or "how?" would both be appreciated.

*** Anyone learned anything new on this topic? Any announcements I haven't heard about?

+2  A: 

I had the same issue and wrote a geocoding class. http://web.me.com/andreas.bungert/erle%5Fmuss%5Fsein/iPhone%5FDevelopment/Einträge/2009/7/9_Geocoding_im_SDK.html

Best Regards

Erle
Cool, thanks. I ended up using code supplied by Bill Dudney (http://www.pragprog.com/screencasts/v-bdmapkit/using-the-map-kit).
Amagrammer
@Erle: I can't find your code and @Amagrammer code either.
VansFannel
@VansFannel I reuploaded it under http://files.mettigel-software.com/TSGeocoder.zip There are some bugs in it, i think. If I got some time i will remove them
Erle
+1  A: 

I am looking at the source code available from:

http://www.pragprog.com/screencasts/v-bdmapkit/using-the-map-kit

In what part the forward geocoding used?

Thanks

Yoichi
It doesn't look like that example uses either form of geocoding (forward OR reverse)
Amagrammer
That's the link you provided, and that was the only MapKit source could get there. How did you get the source code you used? Or, was it a compiled commercial library?
Yoichi
I must have provided the wrong link, sorry. I don't have time to backtrack now, but I will try to figure it out later.
Amagrammer
@Amagrammer: Have you updated the url to get the correct geocoder?
VansFannel
+2  A: 

merrimack wrote an answer here with a useful example..

http://stackoverflow.com/questions/1140404/forward-geocoding-from-the-iphone/2444249#2444249

There is a nice blog post of him

http://blog.sallarp.com/ipad-iphone-forward-geocoding-api-google/

Sijo