0

I have a LOCATIONS table in sqlite:

CREATE TABLE LOCATIONS (LOCATION_ID INTEGER PRIMARY KEY, PLACE_NAME, CITY TEXT, COUNTRY TEXT, LAT REAL, LNG REAL, IMAGE BLOB);

I'd like to implement the following method on a LocationDao

- (GTPLocation*)findByLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;

How does sqlite handle searching by CGFloat? Do the normal issues with float comparison still apply? Would it be better to store these values as strings?

All of my locations will come from different sources, but get pumped through Apple's standard CLLocation geocoder, before being saved in the database.

Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
  • 1
    Are the searches always using exactly the same values that you've previously written? – CL. Oct 07 '13 at 10:32
  • @CL. The use-cases might expand. But for now, yes, I'm just caching commonly retrieved locations - I'll hit the cache, for using the network service again. – Jasper Blues Oct 07 '13 at 10:44
  • I would say either use the BETWEEN operator or use the round(x,y) function. – Hot Licks Oct 07 '13 at 10:58

0 Answers0