def DrawBorders(m, products):
"""
?????
:param m: ?????plt?????plt)
:param products: ????
:return:
"""
try:
for area in products.map.borders:
if not area.draw:
continue
if area.filetype == 'SHP': # shp??
if m is plt:
Map.DrawShapeFile(area)
else:
m.readshapefile(area.file.replace('.shp', ''),
os.path.basename(area.file),
color=area.linecolor)
else: # ???? , ??? ???????????
if area.path is None:
continue
if area.polygon == 'ON':
area_patch = patches.PathPatch(area.path, linewidth=area.linewidth, linestyle='solid',
facecolor='none', edgecolor=area.linecolor)
plt.gca().add_patch(area_patch)
else:
x, y = zip(*area.path.vertices)
m.plot(x, y, 'k-', linewidth=area.linewidth, color=area.linecolor)
except Exception as err:
print(u'?{0}?{1}-{2}'.format(products.xmlfile, err, datetime.now()))
评论列表
文章目录