Get zip code from latitude, longitude?

后端 未结 5 2020
长发绾君心
长发绾君心 2020-12-01 06:56

I want to get zip code from users current location(Latitude, Longitude), I had used MKReverse Geocoder delegate methods, but sometimes I am not able to get zip code informat

5条回答
  •  隐瞒了意图╮
    2020-12-01 07:22

    If you have a free db (available from that site? Just search for zip code database and you'll see it)

    then you can run an internal SQL query testing for nearby lat/longs. That way you won't need to worry about licensing a web service.

    You have three options then. SQL BETWEEN statement, the hypotenuse equation, or Haversine. Haversine being the best, luckily it's tutorial'd elsewhere

提交回复
热议问题