2
Geopandasポリゴンからmatplotlibパッチへのポリゴン変換
残念ながら、ジオパンダのプロットは非常に遅く、多くのリソースを必要とするため、プロットには代わりにmatplotlibを使用したいと思います。 純粋なフィオナを使用してシェープファイルを開いて読み取る場合、matplotlibパッチとしてポリゴンを抽出するのに問題はありませんが、今度はgeopandasデータフレームを使用してmatplotlibポリゴンを取得します。 私は現在次のようなものを使用しています: with FI.open(df_map_elements, 'r') as layer: for element in layer: key = int(element['id']) if key not in dict_mapindex_mpl_polygon.keys(): dict_mapindex_mpl_polygon[key]=[] for tp in element['geometry']['coordinates']: q = np.array(tp) polygon = Polygon(q) # matplotlib Polygon NOT Shapely matplotlibでポリゴンをプロットする場合: from matplotlib import pyplot as plt from matplotlib.patches import Polygon from matplotlib.collections import …