centroid property

This commit is contained in:
Kelsey Jordahl committed 2013-06-27 07:41:15 -05:00
1 parent 4e9f80c847
commit 4c74f37bc4
1 file changed
+7
+7
View File
@@ -79,6 +79,13 @@ class GeoSeries(Series):
columns=['minx', 'miny', 'maxx', 'maxy'],
index=self.index)
@property
def centroid(self):
"""
Return the centroid of each geometry in the GeoSeries
"""
return GeoSeries([geom.centroid for geom in self], index=self.index)
@property
def geom_type(self):
return Series([geom.geom_type for geom in self], index=self.index)