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

measure.sh 375 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
  1. #!/usr/bin/env bash
  2. #
  3. cat << EOF > area.txt
  4. 0 0
  5. 1 0
  6. 1 1
  7. 0 1
  8. 0 0
  9. EOF
  10. # Cartesian centroid and area
  11. echo "0.5 0.5 1" > answer
  12. gmt spatial -Q area.txt > result
  13. diff -q --strip-trailing-cr answer result > fail
  14. # Geographic centroid and area
  15. echo "0.5 0.500007020071 12281.2810988" > answer
  16. gmt spatial -Q area.txt -fg > result
  17. diff -q --strip-trailing-cr answer result >> fail
Tip!

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

Comments

Loading...