Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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]))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 8
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]))