iphone - Optimizing The Way To Know most nearby objects -


i'm using core location ios 6 this.

scenario:

i have spacial coordinates of sample of points. save coords using core data. , when moving iphone, need detect if 500m points in sample.

right now, looping through points , calculating distances of them current location. user's current location changing. thing not idea if have 100 points, 1000 points.etc

question:

how can optimize this, hint?

idea:

  • rasterize (grid) objects , asign each object grid-object (clustering).

  • while moving, detect grids intersecting current position/radius.

  • get nearby object(s) inside grids.

so need calculate distances of grid-objects , distances objects inside grid-objects nearby position.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -