Unfortunately geopandas plotting is extremely slow and takes a lot of resources, hence I would like to use instead matplotlib for plotting.
When I use pure Fiona to open and read the shapefile I have no trouble to extract the Polygons as matplotlib patches but now I would like to use as starting point the geopandas dataframe to get my matplotlib Polygons.
I am currently using something like:
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
For plotting polygons with matplotlib:
from matplotlib import pyplot as plt from matplotlib.patches import Polygon from matplotlib.collections import PatchCollection