Rr Projects
Posts: 0
Joined: Sun Dec 14, 2014 5:53 pm

How do I match geolocation to other app user in the vicinity?

Hi there,

I am new at Appery and app development and am trying to figure out how to build an app that uses the users location and seeks for other users in a x mile/km radius. The users location may vary and is determined by GPS from the device.

I searched the net and watched various videos on geolocation but I can't quite find anything on this topic. Please can you share with me some pointers, info, websites and/or videos if available?

Thanks!

Rira

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How do I match geolocation to other app user in the vicinity?

Hello Rira,

I'm assuming that you plan on updating a database table with each users geolocation with some frequency when they are logged in ....

You can and likely should store thei geolocation in a database field with type of 'geopoint' .... Google MongoDb geopoint data type' for a little more on this.

You client app can then Query the db geopoint field for users within a radius of their location. It's a built in feature of Mongodb which Appery uses on the backend.

If you'd like a sample query that does this ... Let me know I'll post it here. Do a quick -15 minute read on a geopoint query first to get the general idea ...

Best,

Bruce

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How do I match geolocation to other app user in the vicinity?

Hi Rira,

Here is a brief plan for it:

  1. Get current user position with geolocation service.
    Details: http://devcenter.appery.io/tutorials/...

  2. Make geospatial query to DB.
    Details are here: http://devcenter.appery.io/documentat...

    Also you should use geopoint field for the collection of your users to make query.

    Bruce thanks for this explanation.

    Regards.

Bruce Buttles
Posts: 0
Joined: Tue Oct 20, 2015 7:44 pm

How do I match geolocation to other app user in the vicinity?

Bummer, the link in your bullet #2 does not take you to anything that helps. Can you send me the link to the "Make geospatial query to DB" examples?

Bruce Buttles
Posts: 0
Joined: Tue Oct 20, 2015 7:44 pm

How do I match geolocation to other app user in the vicinity?

Okay - we will continue the dialog here.
Where can I find good examples of making a geospatial query to the DB using a geopoint column?

Raj K
Posts: 0
Joined: Fri Apr 28, 2017 12:24 am

How do I match geolocation to other app user in the vicinity?

Can the geolocation service be used to find two users/devices that are in a very close proximity like 10 feet or less?

Thanks,
Kiran

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

How do I match geolocation to other app user in the vicinity?

Hello Kiran,

The Geolocation service is reading coordinates of the device on which it runs, if you need to read coordinates of another device then you'll need to use transmitter-receiver approach on both devices. In Appery.io apps this can only be implemented with Cordova plugin functionality.

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How do I match geolocation to other app user in the vicinity?

Kiran,

Illya is correct literally.

If however you were to have both devices logging their locations to a Appery database, you could have the devices on the impacted devices doing Geospatial queries to find other users within a given distance.

However, 10 feet or less is an extremely low 'accuracy' - and most geolocation readings coming from your phone do not give an accuracy of within 10 yards.... 30-50 feet is a more likely goal.

Also - unless you are using background GeoLocation (there are plugins that do this) the users would have to be active in the app - in order for this approach to work. (Your app will not receive location information once it has become 'backgrounded' - generally 1-3 minutes of in-activity unless you use the plugin approach).

Keep in mind - The background geolocation approach is is 'high end' and requires some experience to code and manage.

Best,
Bruce

Return to “Issues”