Re: -Sq Line Annotation between two coordinates
Paul Wessel <[email protected]> Sun, 27 Apr 2014 23:26:06 -1000
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
Might have to do some scripting. Some ideas: 1) Use mapproject -GC- on your airway coordinates with -R -J as for your map. The unit C means Unit C means Cartesian distances after first projecting the input coordinates (-R, -J), and the trailing - means get increments (distance between successive points). So now you have airway coordinates and distances between them in projected cm on the map. You would need a script to determine which increments exceed 1.5 cm and then determine the mid-point between these two and place a label there. Since the mid-point should be on a great circle you may need to use gmtvector -Ta on the two end points to get it right. If you need the label to be in a particular angle at that point then perhaps it gets tricky. 2) As above to determine which segments exceed 1.5 cm, split those pairs into 2-line files, compute the great circle distance (here called <length> in km), and now use -Sq:D<length>k/0.5(and either +l<name> or via +Lh). Unfortunately, -GC- will not give you great circle distance in cm, it will give straight line distance. If you need GC distance in projected cm then you will need to resample between your points first (with sample1d) and then do some of the stuff above. Perhaps the -GC- is good enough in determining which lines to annotate. Paul On Apr 27, 2014, at 3:22 PM, Kristof Koch <[email protected]> wrote: > Dear List, > > I'm plotting some airways which are basically great circle segments between arbitrary coordinates. Every airway has a name as well (similar to a highway number) which I want to plot along the airway. > > The data comes as a list of coordinates per airway: > > -43.16 60.057 > -40.00 61.00 > -30.00 63.00 > -22.61 63.987 > […] > > My problem: The label should be in the middle between two coordinates, but only if the distance between the two coordinates on the resulting chart is greater than 1.5cm. > > I didn't find an appropriate solution in the CookBook at "26. N. Annotation of Contours and “Quoted Lines”". There seems to be no way of achieving this with the algorithms provided. Caution: Please don't underestimate the chances of me not seeing the wood for the trees. > > The only idea I currently have is to calculate the midpoints of my airway segments. This would place the labels in the middle with -Sqf..., however it doesn't solve the problem with the desired segment length limitation. > > Your ideas are highly welcome. > > Regards, > Kristof > > > -- > My PGP Public Key: http://kristofkoch.de/pgp/ > > > To unsubscribe, send the message "signoff gmt-help" to [email protected] To unsubscribe, send the message "signoff gmt-help" to [email protected]