Source code supporting forward and reverse geocoder

Source: Internet
Author: User

This article is transferred fromHttp://blog.csdn.net/favormm/archive/2011/06/29/6574658.aspx

In ios sdk, There is only reverse gecoder, that is, the resolution from the longitude and latitude to the address, and there is no forward resolution from the address to the latitude and longitude. To support forward resolution, you only need to directly call the Google API. Today I will share with you two open-source projects that support forward and reverse resolution.

    • Https://github.com/mjisrawi/iOS-Geocoding-Services
    • Https://github.com/samvermette/SVGeocoder usage: http://samvermette.com/164

Tweet this

Svgeocoder

# Releases, # iphonedev

There is no forward geocoding class on IOS. and it's no secret that mkreversegeocoder is a pain in the butt and returns with an error half of the time. so I took the opportunity to write svgeocoder, a simple geocoder and reverse geocoder for IOS. my first GitHub release!

Svgeocoder requires the corelocation, mapkit and addressbook frameworks as well as the (pinned) touchjson parser by Jonathan Wight. it also uses the Google geocoding API so make sure you read theirterms of service before using svgeocoder.

Using the geocoder
Nsstring *Addressstring = @ "3245 St-Denis, Montreal"Svgeocoder *Geocoderequest = [[Svgeocoder Alloc] Initwithaddress:Addressstring];[Geocoderequest Setdelegate:Self];[Geocoderequest Startasynchronous];
View rawgeocoder. mThis gist brought to you by GitHub. Using the reverse geocoder
  cllocationcoordinate2d   coordinate  =
     cllocationcoordinate2dmake   (  45.54181  ,  -  73.62928   );   svgeocoder   *   rgeocoderrequest  =  [[  svgeocoder   alloc  ]   initwithcoordinate:   coordinate  ];   [  rgeocoderrequest   setdelegate:   Self  ];   [  rgeocoderrequest   startasynchronous  ];  
View rawreversegeocoder. mThis gist brought to you by GitHub. svgeocoderdelegate

Best of all, svgeocoderdelegate returns an mkplacemark object just like with mkreversegeocoder:

- (Void)Geocoder:(Svgeocoder *)Geocoder Didfindplacemark:(Mkplacemark *)Placemark;- (Void)Geocoder:(Svgeocoder *)Geocoder Didfailwitherror:(Nserror *)Error;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.