3 ms·
the algorithm works this way: The geolocation acquired by the webpage is in the form of latitude and longitude. Let's say it is lat: 10.123456, long: 30.123456
by bubblic 4y ago
the algorithm works this way:
The geolocation acquired by the webpage is in the form of latitude and longitude. Let's say it is lat: 10.123456, long: 30.123456
I want to approximate it to 3 mile accuracy (diagonal of a box, so in one dimension, would be sqrt(3^2 /2) = 2.12 mile in lat or long). 3 mile, in geographical coordinate would be equivalent to : 3 mile / 3960 mile (Earth radius) * 180 deg / pi rad = 0.0434 degree.
I divide each dimension by 0.0434, and round it to a whole number (essentially, mod 0.0434). Then, I multiply that number by 0.0434 and save that as the location.
This means that a user's location can lie anywhere inside a box with 3 mile diagonal length at that geolocation.
If you see inconsistency in my logic, please let me know.
- JonChesterfield 4y agoThat would leak if there are multiple data points. In the extreme case, two points just either side of the 3 mile circle resolution would locate precisely (where the two circles touch). Given N points within M meters or so, which is roughly what you get for multiple measurements of "home" with an error on the measurement, I think you could have a reasonable stab at deriving the location from an estimate of the error on the geolocation plus which circles they fell into. All in same circle makes near centre more likely than near edge. edit: daily check in, so all the above needs is a tendency to check in from roughly the same location each day.