I have to find whether the line feature is self intersected or not.
I have tried the below logic but I am not getting it.
Is there a way to find the solution?
lineLayerName=self.lineLayer.name()
for ft in self.lineLayer.getFeatures():
if ft.geometry().intersects(ft.geometry()):
gem = ft.geometry().intersection(ft.geometry())
intPt=gem.asPoint()
if intPt.x() != 0 and intPt.y() != 0:
print "Self-intersected"
If the line is self-intersected means I need the intersected point. I have attached the screenshot for reference.