2

I have about 10000 place location on my server side database, I want to send a notification to mobile users that in one of this places (like foursquare), I don't have geofence of this places.
I googled it and find Foursquare Pilgrim SDK that does not released now (I think), but according to the foursquare documentation it works just for places that exists in foursquare DB, Is there any library that do it with my data or is it possible?!
I know using only GPS data is not accurate to find someone is somewhere because there are some places located side by side each other and accuracy of GPS data does not support that.

Edited:
After a lot of searching on the internet I found this library Radar, It's so simple and free, it accept unlimited geofences with unlimited users, both server side and client side notification for entering a geofence.

majidkabir
  • 132
  • 11
  • "I don't have geofence of this places" means you have only lat/lon information, and not have radius for these places ? – blackkara May 08 '17 at 05:49
  • According to foursquare pilgrid, its not calculate geofence just by lat/lng and radius, but I just have lat/lng and I want to find the best accurate method for this. – majidkabir May 08 '17 at 06:05
  • `its not calculate geofence just by lat/lng and radius` This is exactly what i want to mention. You just have lat/lon but not have radius. To be located in a place, we must define a fence(circle based on radius), so based on this fence, we will detect the location is in or not. – blackkara May 08 '17 at 06:30
  • I think my question is not clear, If I have a accurate location of my user in small time intervals, I can get more accurate result without correct radius. But is there a way for this? It does use a good amount of battery. Maybe a hybrid solution works for it, using android geofence and server side process, but android geofence is limited to 100 geofence! Is there any way for dynamic adding geofence based on not accurate location?! For example adding nearby 100 place geofence to android geofence, It should update by location of user! Is there any way? – majidkabir May 08 '17 at 06:42
  • Android geofencing calculates required things under the hood instead of you, but have 100 geofence limit. This is called device-side geofencing, but you could refer to server-side geofencing. So you must send location to server periodically or when press a button. The server does all of the process(detecting the location within a place or not) Based on response you can show notification. You can check this [response](http://stackoverflow.com/a/36965413/1281180) for similar purpose. – blackkara May 08 '17 at 07:18

2 Answers2

0

You can implement code to server side that user location is in predefined place's radius or not. If you have 10000 place's lat/long saved server side then you can write script at server side for finding that user's lat/long is in defined radius of place's lat/long.

SilverSky
  • 431
  • 4
  • 3
  • I use [solr](http://lucene.apache.org/solr/) for indexing my data, and I can use lat/lng with a radius to query my database for finding places that near it, but it's more complicated. In a complex when you query for nearby places, return data maybe more than 100. – majidkabir May 08 '17 at 06:23
  • And I cant send accurate location to my server, because it does use a good amount of battery. Maybe using android geofece with server side checking is a solution but android geofence just get 100 geofence. – majidkabir May 08 '17 at 06:30
0

You can implement this by the following approach.

  1. Application sending the location updates to server in a regular interval of time.
  2. In server BLL you needs to find out if this Latitude and Longitude falls within the vicinity of available DataBase records.

Something similar to the following in JavaScript api reference

var distance = google.maps.geometry.spherical.computeDistanceBetween(a, b);

In Android its similar to

public static final float NEAR_BY_MINIMUM_CRITERIA =5.0f;
public boolean areTheseLocationsNearBy(Location one,Location two){
        if(one.distanceTo(two) <AppConstants.NEAR_BY_MINIMUM_CRITERIA){
            Log.d(TAG,"areTheseLocationsNearBy criteria 5.0 satisfied == true");
         return true;
        }
   return false;
    }

If the current location fall's within this range, then send notification to application.

Sreehari
  • 5,621
  • 2
  • 25
  • 59