From c582e8da6fa4f4e4ed8b49a8e0f4d6566cf8fdcc Mon Sep 17 00:00:00 2001 From: Kelsey Jordahl Date: Sat, 19 Apr 2014 14:03:47 -0400 Subject: [PATCH] BUG: Use explicit call to Point() instead of global variables --- geopandas/geoseries.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/geopandas/geoseries.py b/geopandas/geoseries.py index 8847332..25316e7 100644 --- a/geopandas/geoseries.py +++ b/geopandas/geoseries.py @@ -14,11 +14,6 @@ from geopandas.base import GeoPandasBase OLD_PANDAS = issubclass(Series, np.ndarray) -EMPTY_COLLECTION = GeometryCollection() -EMPTY_POLYGON = Polygon() -EMPTY_POINT = Point() - - def _is_empty(x): try: return x.is_empty @@ -157,7 +152,7 @@ class GeoSeries(GeoPandasBase, Series): val = self.apply(_is_empty) return np.logical_or(non_geo_null, val) - def fillna(self, value=EMPTY_POLYGON, method=None, inplace=False, + def fillna(self, value=Point(), method=None, inplace=False, **kwargs): """Fill NA/NaN values with a geometry (empty polygon by default). @@ -180,7 +175,7 @@ class GeoSeries(GeoPandasBase, Series): raise ValueError('Non-geometric fill values not allowed for GeoSeries') def align(self, other, join='outer', level=None, copy=True, - fill_value=EMPTY_POLYGON, **kwargs): + fill_value=Point(), **kwargs): left, right = super(GeoSeries, self).align(other, join=join, level=level, copy=copy, fill_value=fill_value,