本文整理匯總了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)