本文整理汇总了Python中qgis.core.QgsHashedLineSymbolLayer.setHashAngle方法的典型用法代码示例。如果您正苦于以下问题:Python QgsHashedLineSymbolLayer.setHashAngle方法的具体用法?Python QgsHashedLineSymbolLayer.setHashAngle怎么用?Python QgsHashedLineSymbolLayer.setHashAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.core.QgsHashedLineSymbolLayer
的用法示例。
在下文中一共展示了QgsHashedLineSymbolLayer.setHashAngle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testHashAngle
# 需要导入模块: from qgis.core import QgsHashedLineSymbolLayer [as 别名]
# 或者: from qgis.core.QgsHashedLineSymbolLayer import setHashAngle [as 别名]
def testHashAngle(self):
s = QgsLineSymbol()
s.deleteSymbolLayer(0)
hash_line = QgsHashedLineSymbolLayer(True)
hash_line.setPlacement(QgsTemplatedLineSymbolLayerBase.Interval)
hash_line.setInterval(6)
simple_line = QgsSimpleLineSymbolLayer()
simple_line.setColor(QColor(0, 255, 0))
simple_line.setWidth(1)
line_symbol = QgsLineSymbol()
line_symbol.changeSymbolLayer(0, simple_line)
hash_line.setSubSymbol(line_symbol)
hash_line.setHashLength(7)
hash_line.setHashAngle(45)
hash_line.setAverageAngleLength(0)
s.appendSymbolLayer(hash_line.clone())
g = QgsGeometry.fromWkt('LineString(0 0, 10 10, 10 0)')
rendered_image = self.renderGeometry(s, g)
assert self.imageCheck('line_hash_angle', 'line_hash_angle', rendered_image)
s.symbolLayer(0).setRotateSymbols(False)
g = QgsGeometry.fromWkt('LineString(0 0, 10 10, 10 0)')
rendered_image = self.renderGeometry(s, g)
assert self.imageCheck('line_hash_no_rotate', 'line_hash_no_rotate', rendered_image)