Rewrite the loop on vertices
Motivation: performance. We eliminate repeated reading of the same information from the shapefiles. If the length of the segment is smaller than 14 days then we re-use for the last part of the segment some of the properties from the first part. Also, we do not compute properties for the first part of the segment if the segment has no predecessor and for the last part of the segment if the segment has no successor.