mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-10 12:00:21 +08:00
No need to use a geoseries
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user