def getProjectedPatch(polygon, m, edgecolor, facecolor, lw=1., zorder=10):
polyjson = mapping(polygon)
tlist = []
for sequence in polyjson['coordinates']:
lon, lat = list(zip(*sequence))
x, y = m(lon, lat)
tlist.append(tuple(zip(x, y)))
polyjson['coordinates'] = tuple(tlist)
ppolygon = shape(polyjson)
patch = PolygonPatch(ppolygon, facecolor=facecolor, edgecolor=edgecolor,
zorder=zorder, linewidth=lw, fill=True, visible=True)
return patch
评论列表
文章目录