1

Most people are limited to about 5 or 6 locations on a daily basis (work, home, school, store, etc). I want to speed up address display by caching a few of these most visited locations. I've been able to get the address info using both google maps GPS and JSON and Locator.reverseGeocode. What would be the best way to cache this information and to check proximity quickly? I found this GPS distance calculation example and have it working. Is there a faster way to check for proximity?

Maksym Gontar
  • 22,765
  • 10
  • 78
  • 114
kyle
  • 268
  • 6
  • 18

1 Answers1

0

Please see similar question first: Optimization of a distance calculation function

There are several things we can change in distance calculations to improve performance:

  1. Measure device speed and decrease or increase period of proximity test accordingly
  2. Trigonometric calculations takes most of performence, but it may done much faster. First make bold distance calculations using lookup table method, then if distance is less than proximity limit + uncertainty limit, use CORDIC method for more precise calculation.
  3. Use constants for Math.PI/180.0 and 180.0/Math.PI

several links that may be helpful:
Very useful explanations of CORDIC, especially doc from Parallax for dummies
Fast transcendent / trigonometric functions for Java
Cordic.java at Trac by Thomas B. Preusser
Cordic.java at seng440 proj
Sin/Cos look-up table source at processing.org by toxi

Community
  • 1
  • 1
Maksym Gontar
  • 22,765
  • 10
  • 78
  • 114