From 99e44fc0b44dfa263e86a081e0a97d03abb39980 Mon Sep 17 00:00:00 2001 From: Matthew Perry Date: Mon, 21 Jul 2014 09:30:30 -0700 Subject: [PATCH] No need to use a geoseries --- geopandas/tools/overlay.py | 5 ----- tests/test_overlay.py | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/geopandas/tools/overlay.py b/geopandas/tools/overlay.py index a115e63..1350476 100644 --- a/geopandas/tools/overlay.py +++ b/geopandas/tools/overlay.py @@ -166,11 +166,6 @@ def overlay(df1, df2, how, use_sindex=True): # Create a geoseries and add it to the collection out_series['geometry'] = newpoly - - # FIXME is there a more idomatic way to append a geometry to a Series - # and get a GeoSeries back? - out_series.__class__ = GeoSeries - out_series._geometry_column_name = 'geometry' collection.append(out_series) # Return geodataframe with new indicies diff --git a/tests/test_overlay.py b/tests/test_overlay.py index 83f51f9..4d0961f 100644 --- a/tests/test_overlay.py +++ b/tests/test_overlay.py @@ -38,6 +38,7 @@ class TestDataFrame(unittest.TestCase): def test_union(self): df = overlay(self.polydf, self.polydf2, how="union") + self.assertTrue(type(df) is GeoDataFrame) self.assertEquals(df.shape, self.union_shape) self.assertTrue('value1' in df.columns and 'Shape_Area' in df.columns)