I have 250 polylines. I have a value i calculated (all different) that needs to be added to the length of the. The values are in the attribute table. How can I increase the length of the lines using the values in the table as the distance to add to the lines?
Solved! Go to Solution.
Mr_Kirkwood, how do you want to handle multi-part lines? Do you want each part to be extended/shortened or just the "last" part, what "last" means in the context of a multi-part line?
The problem with multi-part lines, is that the parts not necessarily will be in a proper order. The "assumption" (here we go again) that the last part is the actual end part of the line, is not necessarily true and parts do not have to be connected or share the same direction. In this case the sample script will also apply the distance for each part and not as a total (distance from attribute divided by part count). Maybe for the sake of simplicity it would be good to assume single parts? And yes, when you apply segmentAlongLine on an illogically ordered multi-part line feature, you will obtain strange results...
Just the end of a single non-multipart line needs to be extended or retracted a distance
What i mean to say is there is one start vertice and one end vertice