Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 651 Bytes

README.org

File metadata and controls

17 lines (16 loc) · 651 Bytes

HexGrid GEO

Basics

GEO wrapper for HexGrid.

Examples

import com.gojuno.hexgrid.*;
import com.gojuno.hexgridgeo.*;

HexGridGeo grid = new HexGridGeo(Orientation.FLAT, 500, ProjectionSM.INSTANCE);
Hex hex = grid.hexAt(new PointGeo(-73.5, 40.3));
long code = grid.hexToCode(hex);
Hex restoredHex = grid.hexFromCode(code);
Hex[] neighbors = grid.hexNeighbors(hex, 2);
Region region = grid.createRegion(new PointGeo[]{
        new PointGeo(-73.0, 40.0), new PointGeo(-74.0, 40.0), new PointGeo(-74.0, 41.0), new PointGeo(-73.0, 41.0));
Hex[] hexesInRegion = region.getHexes();