Library for creating hex grid on sphere
repositories {
...
maven { url "https://jitpack.io" }
}
compile 'com.github.cortwave:geogrid:0.1.0'
int detalizationLevel = 12;
Grid<Hex> grid = new HexGrid(detalizationLevel);
double latitude = -35.44;
double longitude = 22.34;
GeoPoint point = new GeoPoint(latitude, longitude);
Hex hex = grid.getZoneAt(point);
List<GeoPoint> polygon = hex.getPolygon();
String zoneId = hex.getId();
where b - hex side, d - detalization level, C - Earth meridional circumference (40 007.86 km)
where Sb - hex area, d - detalization level, Se - Earth surface area (510072000 km^2)