You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is the right place for a questions like this, if it's not I apologize. I'm trying to figure out the optimal way to take a list of geohashes and return a sub-list that contains the geohashes that are direct neighbors or have direct neighbors in common (aka - creating groups of contiguous geohashes).
The only way I can think to do this is by looping through the geohashes, getting neighbors and adding them to a new list. Something like the psudo code below:
startingGeoHashes = ["9qczj5t",
"9qczj5s", # directly west of the above
"9qczj5e", # directly west of the above
"9qczjhh" # not a direct neighbor
]
neighborGroup = []
foreach startingGeoHash in startingGeohashes
if any of startingGeoHashes in getGeoHashNeighbors(startingGeoHash):
add both to neighborGroups if they aren't already in there
But I'm wondering if there is a set based approach that could return the subset of direct neighbors without looping through ever record and getting the neighbors. Is this possible?
The text was updated successfully, but these errors were encountered:
I'm not sure if this is the right place for a questions like this, if it's not I apologize. I'm trying to figure out the optimal way to take a list of geohashes and return a sub-list that contains the geohashes that are direct neighbors or have direct neighbors in common (aka - creating groups of contiguous geohashes).
The only way I can think to do this is by looping through the geohashes, getting neighbors and adding them to a new list. Something like the psudo code below:
But I'm wondering if there is a set based approach that could return the subset of direct neighbors without looping through ever record and getting the neighbors. Is this possible?
The text was updated successfully, but these errors were encountered: