Re: -Sq Line Annotation between two coordinates
Kristof Koch <[email protected]> Mon, 28 Apr 2014 15:56:20 +0200
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Paul, thank you for your ideas. In the meantime I wrote some bash functions to deal with some great circle stuff (mid-points, initial courses, highest lattitude, etc). I'll play around with your ideas about how to get the distance in projected cm. I don't need the distance for the content of the label, just for placing the label. The desired result is something similar to this wannabe ascii-art: ----[]----- UN850 -----[]----[]-- UN850 --[]---- ------ = airway [] = waypoint UN850 = name of airway Regards, Kristof Am 28.04.2014 um 11:26 schrieb Paul Wessel <[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] -- My PGP Public Key: http://kristofkoch.de/pgp/ To unsubscribe, send the message "signoff gmt-help" to [email protected]
signature.asc
(application/pgp-signature, 496 B)
-----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJTXl4EAAoJEJ3YS27/3eKHKNgH/jesOF8iV/rBWEuHC1N87Dql sQIH7ZeGLid0A9S6SDW+BRg3fkJ9vsQHFMvKEVYTai00Y4Px0hwsaHQnA6u95jqR ycZSB22/+PYE7DFuIe29P5d4IXqHQ4BPcr6yVIfscecE4zilcDqiHLyAQye2sFGW hbHYMF8+afcQ+FvdGNpSxP0DGXXxTyILMmN005ln+kXLle4MR+RH+S+zdR9AJ5Pr NfvKSjQWDm8O62S2IKfDJZJDFv95edi9uK2GcA5g4q6nUK/ENjf8xv0GBLptKiW0 G+3TasaIgK7B4TqDepbisuflWChmoNTqWt8BQ4XE8wutcO1KKZQ9raCx3Qe6tSo= =WF7N -----END PGP SIGNATURE-----