I wanted to find the length of features in a road layer. So I go through each feature in the layer and used,
line = feature.geometry().asPolyline()
to find the points which particular feature is created and then used haversine formula to calculate the length. But there are some features(roads) which are not as continued lines (shown in image-yellow coloured), so the
line returns an empty list.
Is there any way to find length of those type of features?