Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

waypoints.sh 934 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  1. #!/usr/bin/env bash
  2. # Test mapproject's distance and time calculations
  3. ps=waypoints.ps
  4. data=$(gmt which -G @waypoints.txt)
  5. gmt mapproject -G+un+i+a -Af -Z20+i+a+t2017-01-01T --TIME_UNIT=h $data -: -o2:4,7 --FORMAT_FLOAT_OUT=%.1f > tmp
  6. gmt psxy -R181/185/-7:30/-2 -JM6.5i -P -Baf -BWSne -W0.25p $data -: -K > $ps
  7. gmt psxy -R -J -O -K -Sc0.2c -Gblue $data -: >> $ps
  8. awk '{if (NR == 2) print $2, $1}' $data | gmt psxy -R -J -O -K -Sa0.4c -Gred >> $ps
  9. awk '{if (NR > 2) print $2, $1, $3}' $data | gmt pstext -R -J -O -K -F+f9p+r100 -D0/0.4c >> $ps
  10. cat << EOF > legend
  11. H 20p,Helvetica Map Legend
  12. G 4p
  13. N 0.75 0.9 1.1 0.9
  14. V 0 0.25p
  15. L 16p,0 C WPT#
  16. L 16p,0 C Heading
  17. L 16p,0 C Distance
  18. L 16p,0 C Time
  19. D 0 0.5p
  20. EOF
  21. awk '{if (NR > 1) printf "L 16p,0 C P-%d\nL 16p,0 R %s@.\nL 16p,0 R %s nm\nL 16p,0 R %s hr\n", int($1), $2, $3, $4}' tmp >> legend
  22. echo "V 0 0.25p" >> legend
  23. gmt pslegend -R -J -O -DjTL+w3.75i+o0.1i -F+p1p+gwhite+s legend >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...