Ask HN: Could any iOS Developer Give me some pointers?
I'm quite new to iOS Development and wanna get stuck right in :) I'm just looking to find the best practice for this:
I know I can use CLLocationManager to get the users location but I want to create an app that does this:
User logs in > app checks web server for online users in specified radius in miles/feet of the current users phone > displays users.
What is the best way to go around this? much appreciated for all your help.
4 comments
[ 3.4 ms ] story [ 17.8 ms ] threadHaving said that most databases (on the backend) have spatial extension where you can run queries like 'where inside(point,geometry)'. So you create a bounding box or circle around the user, then run a query. That's faster than calculating distances between all users. The databases have special indices for geographic lookup. Both point and geometry probably need to be specified in WKT format. http://www.gaia-gis.it/spatialite-2.1/SpatiaLite-manual.html http://docs.mongodb.org/manual/applications/geospatial-index...
https://developer.apple.com/library/ios/documentation/CoreLo...: