views:

166

answers:

3

I want to write an iPhone app, that will need to do a distance based search (eg. find results within 100km)

I'm not concerned about what storage technology is used, as long as it is stored on the device

A: 

What are you asking exactly? What do you need to find?

For a generic case I would maybe use the long/lat coords on the "items" to make a quad-tree and use that to speed up the search.

Jonatan Hedborg
+1  A: 

Although I have never used it, there is a spatial derivative of SQLLiteDB that you could compile and use in your app - then you could issue spatial queries against that database. It's something I have mulled over but never had the chance to try:

http://www.gaia-gis.it/spatialite/

Kendall Helmstetter Gelner
+1  A: 

I asked a question a while back intending to build a similar application. I found the answer helpful. I believe what you want to do can be largely accomplished by using CLLocation's getDistanceFrom: method.

Prairiedogg
Given the database only has about 5000 points this is working fast enough, before I've even done some simple boxing in SQL
aussiegeek