Exemplo n.º 1
0
def test_total():
    testcasefile = open("./geohex/tests/testcase.list", "r")
    for line in testcasefile:
        lat, lon, level, hexcode = line.rstrip("\n\r").split(",")
        hex_x, hex_y = deg2hex(int(level), float(lon), float(lat))
        resultcode = encode(int(level), hex_x, hex_y)
        print(resultcode + ":" + hexcode)
        print(hexcode)
        assert resultcode == hexcode
Exemplo n.º 2
0
def test_total():
    testcasefile = open("./geohex/tests/testcase.list", "r")
    for line in testcasefile:
        lat, lon, level, hexcode = line.rstrip("\n\r").split(",")
        hex_x, hex_y = deg2hex(int(level), float(lon), float(lat))
        resultcode = encode(int(level), hex_x, hex_y)
        print(resultcode + ":" + hexcode)
        print(hexcode)
        assert resultcode == hexcode
Exemplo n.º 3
0
def test_deg2hex():
    hex_x, hex_y = deg2hex(4, 139.766084, 35.681382)
    assert hex_x == 417 and hex_y == -149
Exemplo n.º 4
0
def test_deg2hex():
    hex_x, hex_y = deg2hex(4, 139.766084, 35.681382)
    assert hex_x == 417 and hex_y == -149