Feature #655

A new quoted line generating modifier

Added by Paul over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:2014-12-02
Priority:NormalDue date:
Assignee:Paul% Done:

0%

Category:-
Target version:Candidate for next minor release
Platform:

Description

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.

History

#1 Updated by Remko over 2 years ago

Paul wrote:

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 over 2 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.

#3 Updated by Paul over 2 years ago

  • Status changed from Feedback to In Progress

Implemented in r13815 in 5.2 branch. Added test/psxy/segmentize.sh test script. Seems to work - let me know.

#4 Updated by Remko over 2 years ago

  • Status changed from In Progress to Closed

Works for me too.

Also available in: Atom PDF