[英]GeoSeries.plot do not plot the polygon correctly
有趣的是,我定義了一個形狀像
from shapely.geometry import Polygon
s = Polygon([(0, 0), (0, 5), (5, 5), (5, 0)], [[(1, 1), (2, 1), (1, 2)], [(1, 4), (2, 4), (2, 3)]])
s
但是當我把它放在 GeoSeris 中並使用 the.plot()
import geopandas as gpd
t = gpd.GeoSeries(s)
t.plot()
我想知道是什么造成了不同。 謝謝你。
如果您逆時針定義孔,它會起作用:
s = Polygon([(0, 0), (0, 5), (5, 5), (5, 0)],
[[(1, 1), (2, 1), (1, 2)],
[(1, 4), (2, 3), (2, 4)]]) # instead of: [(1, 4), (2, 4), (2, 3)]
t = gpd.GeoSeries(s)
t.plot()
可能與這個問題有關: https://github.com/geopandas/geopandas/issues/951
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.