Ejemplo n.º 1
0
def test_metadata_valid():
    """Get bounds and get stats for all bands."""
    meta = cogeo.metadata(ADDRESS)
    assert meta["address"] == ADDRESS
    assert len(meta["band_descriptions"]) == 3
    assert (1, "band1") == meta["band_descriptions"][0]
    assert len(meta["statistics"].items()) == 3
    assert meta["statistics"][1]["pc"] == [12, 198]
Ejemplo n.º 2
0
def test_metadata_valid_custom():
    """Get bounds and get stats for all bands with custom percentiles."""
    meta = cogeo.metadata(
        ADDRESS, pmin=5, pmax=90, hist_options=dict(bins=20), max_size=128
    )
    assert meta["address"] == ADDRESS
    assert len(meta["statistics"].items()) == 3
    assert len(meta["statistics"][1]["histogram"][0]) == 20
    assert meta["statistics"][1]["pc"] == [29, 192]