I have a map divided in parts using polygons, and I want to measure the length of the boundary between each pair. I am using this script from a tutorial to find the actual neighbors, and then measure the shared boundary with this code:
ring_f = QgsGeometry.fromPolyline(f.geometry().asPolygon()) ring_intersecting = QgsGeometry.fromPolyline(intersecting_f.geometry().asPolygon()) ring_intersection = ring_f.intersection(ring_intersecting)
f is the active feature and
intersecting_f is iterated in a list of
all features intersecting f.
However, the script is giving incomplete measurements in some features. For example, below are, whose shared border is near 367m as measured manually using Qgis, but the script returns 224.91. Wierdly enough, what the script returns coincides with measuring between the red crosses encircled in green by me (it would be nice to now what this crosses are, by the way).
Does anyone have any idea of what might be happening?