Monday, December 31, 2012

[android-developers] Re: Order latitude/longitude list by distance to my current location

If the locations are roughly in the same geographical area then you can use a corrective factor for the longitude difference. The latitude is always the same distance per degree but the longitude distance per degree depends on the latitude (biggest at the equator,zero at the poles). For a latitude of 52 degrees the factor would be around 0.63 etc.

On Monday, December 31, 2012 7:32:18 AM UTC-5, Nelson André wrote:
Hello all,

I have a JSON list that I retrive from one website I have that gives me the following fields:

  • Name
  • Latitude
  • Longitude
This list has around 200 items.

I want to order the list by distance to my current location, closer locations on top.

How may I do this calculation and ordering?

Many Thanks

Nelson

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment