2 ms·
I thought I would share our solution for encoding nearby locations, and subscribing to changes taking place within a certain radius: https://github.com/Qbix/Pl
by EGreg 4y ago
I thought I would share our solution for encoding nearby locations, and subscribing to changes taking place within a certain radius:
https://github.com/Qbix/Platform/blob/master/platform/plugins/Places/classes/Places/Nearby.php https://github.com/Qbix/Platform/blob/master/platform/plugin...
It isn't as easy as you think ... we wound up covering a circle with four quantized lat/long squares, and then anything that is posted to one of those four streams gets additionally vetted by radius ("as the crow flies") from the center point.
Specifically, note the comments here: https://github.com/Qbix/Platform/blob/master/platform/plugins/Places/classes/Places/Nearby.php#L97 https://github.com/Qbix/Platform/blob/master/platform/plugin...