本文整理汇总了Python中gnome.outputters.Renderer.save_background方法的典型用法代码示例。如果您正苦于以下问题:Python Renderer.save_background方法的具体用法?Python Renderer.save_background怎么用?Python Renderer.save_background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnome.outputters.Renderer
的用法示例。
在下文中一共展示了Renderer.save_background方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_show_hide_map_bounds
# 需要导入模块: from gnome.outputters import Renderer [as 别名]
# 或者: from gnome.outputters.Renderer import save_background [as 别名]
def test_show_hide_map_bounds(output_dir):
r = Renderer(bna_star, output_dir, image_size=(600, 600))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_background.png'))
# try again without the map bounds:
r.draw_map_bounds = False
r.draw_background()
r.save_background(os.path.join(output_dir,
'star_background_no_bound.png'))
示例2: test_show_hide_map_bounds
# 需要导入模块: from gnome.outputters import Renderer [as 别名]
# 或者: from gnome.outputters.Renderer import save_background [as 别名]
def test_show_hide_map_bounds():
input_file = os.path.join(data_dir, 'Star.bna')
r = Renderer(input_file, output_dir, image_size=(600, 600))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_background.png'))
# try again without the map bounds:
r.draw_map_bounds = False
r.draw_background()
r.save_background(os.path.join(output_dir,
'star_background_no_bound.png'))
示例3: test_set_viewport
# 需要导入模块: from gnome.outputters import Renderer [as 别名]
# 或者: from gnome.outputters.Renderer import save_background [as 别名]
def test_set_viewport():
"""
tests various rendering, re-zooming, etc
NOTE: this will only test if the code crashes, you have to look
at the rendered images to see if it does the right thing
"""
input_file = os.path.join(data_dir, 'Star.bna')
r = Renderer(input_file, output_dir, image_size=(600, 600),
projection_class=GeoProjection)
# re-scale:
# should show upper right corner
r.viewport = ((-73, 40), (-70, 43))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_upper_right.png'))
# re-scale:
# should show lower right corner
r.viewport = ((-73, 37), (-70, 40))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_lower_right.png'))
# re-scale:
# should show lower left corner
r.viewport = ((-76, 37), (-73, 40))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_lower_left.png'))
# re-scale:
# should show upper left corner
r.viewport = ((-76, 40), (-73, 43))
r.draw_background()
r.save_background(os.path.join(output_dir, 'star_upper_left.png'))