Skip to Content

dessine aire

from descartes.patch import PolygonPatch
 
def plot_poly(ax,ob):
    patch = PolygonPatch(ob, facecolor='#6699cc', edgecolor='#6699cc')
    ax.add_patch(patch)
 
def plot_multipol(ax,ob):
    for polygon in ob:
        plot_poly(ax,polygon)
poly = loads('POLYGON ((1 2, 2 5, 6 5, 7 2, 5 1, 1 2))')
multipoly = loads('MULTIPOLYGON (((2 4, 1 3, 2 2, 4 3, 2 4)),((5 2, 4 2, 4 1, 4 1, 5 1, 5 2)))')
 
plot_poly(ax,poly)
plot_multipol(ax, multipoly)