コード例 #1
0
 def test_can_use_area_cutoff(self, sources, targets):
     result = intersections(sources, targets, area_cutoff=0)
     assert (result.area > 0).all()
コード例 #2
0
 def test_sets_crs(self, sources, targets):
     crs = sources.crs
     assert crs
     inters = intersections(sources, targets)
     assert inters.crs == crs
コード例 #3
0
 def test_gives_expected_index(self, sources, targets_with_str_index):
     expected = manually_compute_intersections(sources, targets_with_str_index)
     result = intersections(sources, targets_with_str_index)
     they_match = result.index == expected.index
     assert they_match.all()
コード例 #4
0
 def test_expected_intersections(self, sources, targets_with_str_index):
     expected = manually_compute_intersections(sources, targets_with_str_index)
     result = intersections(sources, targets_with_str_index)
     assert (result == expected).all()
コード例 #5
0
 def test_indexed_by_source_then_target(self, sources, targets_with_str_index):
     result = intersections(sources, targets_with_str_index)
     assert (result.index.levels[0] == sources.index).all()
     assert (result.index.levels[1] == targets_with_str_index.index).all()
コード例 #6
0
 def test_works_with_non_range_index(self, sources, targets_with_str_index):
     result = intersections(sources, targets_with_str_index)
     assert isinstance(result, geopandas.GeoSeries)
     assert isinstance(result.index, pandas.MultiIndex)
コード例 #7
0
    def test_returns_geoseries_with_multiindex(self, sources, targets):
        result = intersections(sources, targets)

        assert isinstance(result, geopandas.GeoSeries)
        assert isinstance(result.index, pandas.MultiIndex)