def test_query_items(geoms, items, query_geom, expected): """Store enumeration idx""" tree = STRtree(geoms, items) results = tree.query_items(query_geom) expected = [items[idx] for idx in expected] if items is not None else expected assert sorted(results) == sorted(expected)
def test_query_items_with_empty(tree_geometry, geometry, expected): tree = STRtree(tree_geometry) assert tree.query_items(geometry) == expected
def test_query_enumeration_idx(geoms, query_geom, expected): """Store enumeration idx""" tree = STRtree(geoms, range(len(geoms))) results = tree.query_items(query_geom) assert sorted(results) == sorted(expected)