Skip to content

Instantly share code, notes, and snippets.

@davideanastasia
Created September 1, 2019 22:39
Show Gist options
  • Save davideanastasia/b6ba2b826d2ee264e87f71be29560860 to your computer and use it in GitHub Desktop.
Save davideanastasia/b6ba2b826d2ee264e87f71be29560860 to your computer and use it in GitHub Desktop.
spatial_beam_02.java
@Override
public Collection<TiledIntervalWindow> assignWindows(AssignContext c) throws Exception {
H3Core h3 = H3Core.newInstance();
Point point = c.element().getValue().getPoint();
String hexAddr = h3.geoToH3Address(point.getLatitude(), point.getLongitude(), h3Resolution);
TiledIntervalWindow tiw = new TiledIntervalWindow(
hexAddr,
c.timestamp(),
gapDuration);
return Lists.newArrayList(tiw);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment