timhutton / geofun

Exploring location-based fun
2 stars 0 forks source link

See only active users #22

Open timhutton opened 7 years ago

timhutton commented 7 years ago

When playing a game like meet-up, it's annoying to see non-playing users. Want default to be bounding box of players, or perhaps of nearby players, not those in other towns.

rawles commented 7 years ago

I think this is best done on the server. A simple way might be for the server to quickly analyse recent activity of a user and determine if they have moved.

rawles commented 7 years ago

I've added a new endpoint /get/location which is intended to replace /data, but both will work.

Consider a user's location reports for the last ten minutes. The minimum bounding box around these locations is 'boxlat' wide in the latitude dimension, and 'boxlong' in the longitude dimension. 'count' is the number of reports. This is easy to compute on the server, but is probably a pain to convert to metres. Maybe Leaflet can help.

The fields now are:

1: time since last report in seconds. 2: object identifier. 3: type identifier. 4: latitude in degrees. 5: longitude in degrees. 6: accuracy in metres. 7: box width in the latitude dimension in degrees. 8: box width in the longitude dimension in degrees. 9: count of the number of reports in the last ten minutes (approx). 10 to 14: slots 1 to 5.