2

In the QGIS properties of a layer I want to activate "draw line only inside polygon" for a specific layer, but using Python. I don't want to use the GUI for it.

Can this be done?

I set the line width with the following code:

props['line_width'] = '1.0'
lineLayer = QgsSymbolLayerV2Registry.instance().symbolLayerMetadata("SimpleLine").createSymbolLayer(props)

Does anyone have any idea how to check the "draw line only inside polygon" checkbox?

Please see attached image. Qgis layer properties

2
  • This worked props['draw_inside_polygon'] = '1'.
    – Peter Odd
    Commented May 31, 2016 at 9:49
  • You should consider posting your comment as an answer and then accepting it (which can only be done 2 days after first posting the question) =)
    – Joseph
    Commented May 31, 2016 at 10:48

1 Answer 1

1

To set "Draw line only inside polygon" using python I used

props['draw_inside_polygon'] = '1'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.