first implementation of iterative greedy algorithm to detect regular trips

This commit is contained in:
2026-01-12 16:19:28 +01:00
parent 160b883bfc
commit 474813b2b9
12 changed files with 447 additions and 6 deletions
@@ -61,7 +61,7 @@ public class H3Service {
}
/**
* Get all cells within k distance of the given cell (including the cell itself).
* Get all cells within k distance of the given cell (excluding the cell it self).
* K-ring distance means cells reachable in k steps on the hexagonal grid.
*
* @param cellId H3 cell ID as hex string
@@ -69,11 +69,12 @@ public class H3Service {
* @return List of H3 cell IDs including the origin cell
*/
public List<String> getKRingNeighbors(String cellId, int k) {
return h3.gridDisk(cellId, k);
return h3.gridRing(cellId, k);
}
/**
* Get K-ring neighbors using the configured route pattern resolution distance.
* Ring means the center cell is not included.
* Useful for finding nearby locations when matching trip patterns.
*
* @param cellId H3 cell ID as hex string