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

crossings.sh 761 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
  1. #!/usr/bin/env bash
  2. # Test simple line intersection in gmtspatial
  3. # Should be a single intersection at -45.1337990939 -2.32614829776
  4. ps=crossings.ps
  5. gmt project -C22/49 -E-60/-20 -G10 -Q > line1.dat
  6. gmt project -C0/-60 -E-60/30 -G10 -Q > line2.dat
  7. gmt spatial line1.dat line2.dat -Ie -Fl > intersections.dat
  8. echo "-45.1337990939 -2.32614829776" > answer.txt
  9. n=$(gmt info -Fi -o2 intersections.dat)
  10. gmt pscoast -N1 -R-65/25/-62/65 -JQ22/6i -P -A5000 -Wthinnest -Slightblue -Glightbrown -Bafg -B+t"Number of intersections: $n" -Dl -K -Xc > $ps
  11. gmt psxy -R -J -O -K -Sc0.1i -Ggreen answer.txt >> $ps
  12. gmt psxy line1.dat -R -J -O -Wthick,blue -K >> $ps
  13. gmt psxy line2.dat -R -J -O -Wthick,red -K >> $ps
  14. gmt psxy -R -J -O -Sc0.1i -W0.5p intersections.dat >> $ps
Tip!

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

Comments

Loading...