How to use the h3.edge_length function in h3

To help you get started, we’ve selected a few h3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / h3-py / tests / test_h3.py View on Github external
def test_edge_length():
    for i in range(0, 15):
        assert isinstance(h3.edge_length(i), float)
        assert isinstance(h3.edge_length(i, 'm'), float)

    with pytest.raises(ValueError):
        h3.edge_length(5, 'ft')
github uber / h3-py / tests / test_cells_and_edges.py View on Github external
def test_hex_edge_length():
    expected_in_km = {
        0: 1107.712591000,
        1: 418.676005500,
        2: 158.244655800,
        9: 0.174375668,
        15: 0.000509713,
    }

    out = {
        res: h3.edge_length(res, unit='km')
        for res in expected_in_km
    }

    assert out == pytest.approx(expected_in_km)
github uber / h3-py / tests / test_h3.py View on Github external
def test_edge_length():
    for i in range(0, 15):
        assert isinstance(h3.edge_length(i), float)
        assert isinstance(h3.edge_length(i, 'm'), float)

    with pytest.raises(ValueError):
        h3.edge_length(5, 'ft')
github uber / h3-py / tests / test_h3.py View on Github external
def test_edge_length():
    for i in range(0, 15):
        assert isinstance(h3.edge_length(i), float)
        assert isinstance(h3.edge_length(i, 'm'), float)

    with pytest.raises(ValueError):
        h3.edge_length(5, 'ft')