Question

Python Caller: appendLine


Badge

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


2 replies

Userlevel 4

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)
Badge

@david_r

 

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

Reply