mirror of
https://github.com/wassname/geopandas.git
synced 2026-10-04 12:40:08 +08:00
centroid property
This commit is contained in:
1 parent
4e9f80c847
commit
4c74f37bc4
1 file changed
+7
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user