def test_commutativity(multiregions_pair: MultiregionsPair) -> None: left_multiregion, right_multiregion = multiregions_pair result = complete_intersect_multiregions(left_multiregion, right_multiregion) assert result == complete_intersect_multiregions(right_multiregion, left_multiregion)
def test_reversals(multiregions_pair: MultiregionsPair) -> None: left_multiregion, right_multiregion = multiregions_pair result = complete_intersect_multiregions(left_multiregion, right_multiregion) assert result == complete_intersect_multiregions( reverse_multiregion(left_multiregion), right_multiregion) assert result == complete_intersect_multiregions( left_multiregion, reverse_multiregion(right_multiregion)) assert result == complete_intersect_multiregions( reverse_multiregion_regions(left_multiregion), right_multiregion) assert result == complete_intersect_multiregions( left_multiregion, reverse_multiregion_regions(right_multiregion))
def test_right_absorbing_element(empty_multiregion_with_multiregion : MultiregionsPair) -> None: empty_multiregion, multiregion = empty_multiregion_with_multiregion result = complete_intersect_multiregions(multiregion, empty_multiregion) assert is_holeless_mix_empty(result)
def test_basic(multiregions_pair: MultiregionsPair) -> None: left_multiregion, right_multiregion = multiregions_pair result = complete_intersect_multiregions(left_multiregion, right_multiregion) assert is_holeless_mix(result)
def _intersect_with_multipolygon( self, other: 'Multipolygon[Coordinate]') -> Compound[Coordinate]: return (complete_intersect_multipolygons( self, other, context=self._context) if (_multipolygon_has_holes(self) or _multipolygon_has_holes(other)) else complete_intersect_multiregions(self._as_multiregion(), other._as_multiregion(), context=self._context))
def test_connection_with_intersect(multiregions_pair: MultiregionsPair ) -> None: left_multiregion, right_multiregion = multiregions_pair result = complete_intersect_multiregions(left_multiregion, right_multiregion) _, _, multiregion = result assert multiregion == intersect_multiregions(left_multiregion, right_multiregion)
def test_idempotence(multiregion: Multiregion) -> None: result = complete_intersect_multiregions(multiregion, multiregion) assert holeless_mix_similar_to_multiregion(result, multiregion)