A new quoted line generating modifier
|Target version:||Candidate for next minor release|
The -Sqn|N mechanism allows us to place one or more labels distributed along the input line. However, it would also be useful to interpret the input line as a series of connected line segments A-B, B-C, C-D, etc where A, B, C are the consecutive points in the input file. I suggest we add -Sqs|S for this purpose. It mostly follows the behavior of -Sqn|N except for the implicit line segments. One issue to solve during implementation is how this interacts with line resampling. For most projections, if we give a file with just a few points A, B, C then the great-circle resampling process (unless -A is used) will add many intermediate points A, A1, A2,..., An, B, B1, B2, ... etc. So while A-B defined a single straight line segment, A-B after resampling is a complex curve with N points. The solution is to find the location of the original points A, B, C in the resampled line and then loop over these segments and pass coordinates from A to B, etc. Alternatively, another approach would be to convert the input data into a set of 2-point line segments and then the existing -Sqn|N would do the rest; this seems to be the cleaner solution.
#1 Updated by Remko almost 3 years ago
Alternatively, another approach would be to convert the input data into a set of 2-point line segments and then the existing -Sqn|N would do the rest; this seems to be the cleaner solution.
This alternative is the approach I would have suggested as well.
#2 Updated by Paul almost 3 years ago
- Status changed from New to Feedback
Yes, I think it is the only sensible way to avoid reinventing all those wheels.
So -SqS|S will basically involve
1. Read in data, convert to 2-point line segments
2. Apply -Sqn|N to the segments.
Step 1 would require a new function
GMT_Segmentize_Data () to be called after input has completed.