tidwall / tile38

Real-time Geospatial and Geofencing
https://tile38.com
MIT License
9.09k stars 569 forks source link

Have roaming geofences return both objects' coordinates #257

Open Drugantibus opened 6 years ago

Drugantibus commented 6 years ago

It'd be really useful if roaming geofences included both objects' position in its JSON; for example, taking the example JSON from the roaming geofences documentation page, something like this:

{
    "command":"set",
    "detect":"roam",
    "hook":"",
    "key":"people",
    "id":"alice",
    "time":"2016-05-24T09:19:44.08649461-07:00",
    "object":{"type":"Point","coordinates":[-115.02,33.02]},
    "nearby":{
        "key":"people",
        "id":"bob",
        "meters":1451.138152186708,
+       "object":{"type":"Point","coordinates":[-115.01,33.01]}
    }
}
tidwall commented 6 years ago

Sorry about the slow response. I think this is a good idea.

My only concern is bloating the size of the notifications. Perhaps we can add a special option to include both objects?

Drugantibus commented 6 years ago

Something like an extra keyword while configuring the geofence? Like NEARBY people FENCE ROAM people * 5000 BOTH? That'd be cool!

tidwall commented 6 years ago

Good tip. I'll see what I can whip up.