I am working on a neural network which operates on polylines with variable number of vertices. To fit each polyline into the ANN the simplify method works well to reduce the number of vertices of long polylines. However to increase the number of vertices for short polylines, I am out of luck (currently I just fill the matrix with zeros but I suspect that may limiting the sensitivity of the model).
I am thinking that segmentize could work similar to simplify where you either pass in max_distance or min_number (but not both), and if you pass in min_number a simple algorithm of inserting a redundant vertex in the center of the longest line iteratively until the min_number is reached.
I am working on a neural network which operates on polylines with variable number of vertices. To fit each polyline into the ANN the simplify method works well to reduce the number of vertices of long polylines. However to increase the number of vertices for short polylines, I am out of luck (currently I just fill the matrix with zeros but I suspect that may limiting the sensitivity of the model).
I am thinking that
segmentizecould work similar tosimplifywhere you either pass inmax_distanceormin_number(but not both), and if you pass inmin_numbera simple algorithm of inserting a redundant vertex in the center of the longest line iteratively until themin_numberis reached.