Skip to main content
Question

Python Caller: appendLine

  • May 23, 2018
  • 2 replies
  • 15 views

Forum|alt.badge.img

Hi,

I use PythonCaller to reconnect lines that were splitted before, if some conditions are met.

#self.LastFeature --> a line I collected before
#GivenFeature --> a matching line that I want to connect to first feature
self.LastFeature.getGeometry().appendLine(GivenFeature.getGeometry())

Both ends meet, but the "LastFeature" doesnt change its Geometry.

Can you explain, why and how to solve this? Do you have a link or search words?

Thanks in advance.

Andreas

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • May 23, 2018

You need to set back the geometry after having modified it.

Try something like the following:

geom = self.LastFeature.getGeometry()
geom.appendLine(GivenFeature.getGeometry())
self.LastFeature.setGeometry(geom)

Forum|alt.badge.img
  • Author
  • 5 replies
  • May 23, 2018

@david_r

 

Thank you very much for the fast answer, this works fine.