Beispiel #1
0
    def _test_binary_topological(self, op, expected, a, b, *args, **kwargs):
        """ Tests for 'intersection', 'union', 'symmetric_difference', etc. """
        if isinstance(expected, GeoPandasBase):
            fcmp = assert_geoseries_equal
        else:
            fcmp = lambda a, b: self.assert_(geom_equals(a, b))

        if isinstance(b, GeoPandasBase):
            right_df = True
        else:
            right_df = False

        self._binary_op_test(op, expected, a, b, fcmp, True, right_df, *args, **kwargs)
Beispiel #2
0
    def _test_binary_topological(self, op, expected, a, b, *args, **kwargs):
        """ Tests for 'intersection', 'union', 'symmetric_difference', etc. """
        if isinstance(expected, GeoPandasBase):
            fcmp = assert_geoseries_equal
        else:
            fcmp = lambda a, b: self.assert_(geom_equals(a, b))

        if isinstance(b, GeoPandasBase):
            right_df = True
        else:
            right_df = False

        self._binary_op_test(op, expected, a, b, fcmp, True, right_df, 
                        *args, **kwargs)
Beispiel #3
0
    def _test_binary_operator(self, op, expected, a, b):
        """
        The operators only have GeoSeries on the left, but can have
        GeoSeries or GeoDataFrame on the right.

        """
        if isinstance(expected, GeoPandasBase):
            fcmp = assert_geoseries_equal
        else:
            fcmp = lambda a, b: self.assert_(geom_equals(a, b))

        if isinstance(b, GeoPandasBase):
            right_df = True
        else:
            right_df = False

        self._binary_op_test(op, expected, a, b, fcmp, False, right_df)
Beispiel #4
0
    def _test_binary_operator(self, op, expected, a, b):
        """
        The operators only have GeoSeries on the left, but can have
        GeoSeries or GeoDataFrame on the right.

        """
        if isinstance(expected, GeoPandasBase):
            fcmp = assert_geoseries_equal
        else:
            fcmp = lambda a, b: self.assert_(geom_equals(a, b))

        if isinstance(b, GeoPandasBase):
            right_df = True
        else:
            right_df = False

        self._binary_op_test(op, expected, a, b, fcmp, False, right_df)
Beispiel #5
0
 def test_fillna(self):
     na = self.na_none.fillna(Point())
     self.assertTrue(isinstance(na[2], BaseGeometry))
     self.assertTrue(na[2].is_empty)
     self.assertTrue(geom_equals(self.na_none[:2], na[:2]))
Beispiel #6
0
 def _test_unary_topological(self, op, expected, a):
     if isinstance(expected, GeoPandasBase):
         fcmp = assert_geoseries_equal
     else:
         fcmp = lambda a, b: self.assert_(geom_equals(a, b))
     self._test_unary(op, expected, a, fcmp)
Beispiel #7
0
 def _test_unary_topological(self, op, expected, a):
     if isinstance(expected, GeoPandasBase):
         fcmp = assert_geoseries_equal
     else:
         fcmp = lambda a, b: self.assert_(geom_equals(a, b))
     self._test_unary(op, expected, a, fcmp)
 def test_fillna(self):
     na = self.na_none.fillna(Point())
     self.assertTrue(isinstance(na[2], BaseGeometry))
     self.assertTrue(na[2].is_empty)
     self.assertTrue(geom_equals(self.na_none[:2], na[:2]))