Use plus codes to find hot spots/clusters

63 views
Skip to first unread message

Nesvarbu Nereikia

unread,
Mar 22, 2022, 12:18:32 PM3/22/22
to Plus Codes Community Forum
Hi,
Would encoding coordinates into plus codes help in finding clusters of nearby points in some efficient, straight forward algorithm?
If I Have a sorted list of plus codes, can derive hot spots from it?

Andreas B

unread,
Mar 24, 2022, 9:31:02 AM3/24/22
to Plus Codes Community Forum
Similar locations tend to have codes with the same prefix, so simply counting the number of times each prefix of a given length appears in your list may reveal clusters. You might miss some clusters with this naive approach, though: if the center of a cluster is located near an intersection point of the OLC grid, in the worst case you might count only 1/4th of your cluster size for each of the neighbouring prefixes.

Tuning the prefix length you are looking for to the typical size of your clusters and the overall distribution of your data might help a bit. My gut feeling, without having tried out for myself, is that this might work well for a certain prefix length if your clusters are much smaller than the length corresponding to that prefix length, and the average distance between clusters is much larger than that length.

Example:
- an 8-digit prefix of a plus code corresponds to an area of about 275m x 275m (give or take, depending on where exactly on the globe)
- if your hot spots are around the size of a restaurant (say, 30x30m), and you have only a dozen of them spread across a larger city (say, >1km between them), it might work well
- if your hot spots are around the size of a park instead (say, 200x300m), or if your individual hot spots are more densely packed (say, the number of traffic lights in that city), detecting them via 8-digit prefix will surely fail

Reply all
Reply to author
Forward
0 new messages