擴大MULTIPOLYGON我有一個包含兩個多邊形和multipolygons如下shape文件:在geopanda數據幀
name geometry
0 AB10 POLYGON ((-2.116454759005259 57.14656265903432...
1 AB11 (POLYGON ((-2.052573095588467 57.1342600856536...
2 AB12 (POLYGON ((-2.128066321470298 57.0368357386797...
3 AB13 POLYGON ((-2.261525922489881 57.10693578217748...
4 AB14 POLYGON ((-2.261525922489879 57.10693578217748...
的第二和第三排對應組合區,而其餘的都是多邊形。 我想將幾何圖形爲Multipolygon類型的行擴展爲Polygon行,如下所示。
name geometry
0 AB10 POLYGON ((-2.116454759005259 57.14656265903432...
1 AB11 POLYGON ((-2.052573095588467 57.1342600856536...
2 AB11 POLYGON ((-2.045849648028651 57.13076387483844...
3 AB12 POLYGON ((-2.128066321470298 57.0368357386797...
4 AB12 POLYGON ((-2.096125852304303 57.14808092585477
3 AB13 POLYGON ((-2.261525922489881 57.10693578217748...
4 AB14 POLYGON ((-2.261525922489879 57.10693578217748...
請注意,AB11和AB12 Multipolygon已擴展爲多行,其中每行對應一個多邊形數據。
我認爲這是geopanda數據處理。有沒有一種pythonic的方式來實現上述?
謝謝!
這不會是沒有非常有幫助一些上下文或一些代碼來重現實際的數據幀。 –