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

ogrtest.sh 901 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
24
25
26
27
28
  1. #!/usr/bin/env bash
  2. #
  3. # Test gmt grdmask for proper handling of perimeter and holes [OGR].
  4. ps=ogrtest.ps
  5. # 1. make a regular mask from a perimeter+hole file
  6. gmt grdmask -R77:03:35W/77:03:10W/38:52:05N/38:52:25N -I0.25s -fg -A @pentagon.gmt -N0/1/2 -Gmask.nc
  7. cat << EOF > mask.cpt
  8. 0 blue 1 -
  9. 1 green 2 -
  10. 2 red 3 -
  11. EOF
  12. gmt grdimage mask.nc -Cmask.cpt -Jx800id -P -Ba10sf5s -BWSne -K -Xc > $ps
  13. gmt psxy -Rmask.nc -J -O -K @pentagon.gmt -W0.25p,white >> $ps
  14. # 2. make an ID grid from a multipolygon file with IDs set to CPT entries
  15. gmt grdmask -R-3/8/-3/5 -I0.1 -r @multihole.gmt -aZ=ID -Nz -GID.nc -fg
  16. cat << EOF > mask.cpt
  17. 0 blue 1 - ;B
  18. 1 green 2 - ;G
  19. 2 red 3 - ;R
  20. 3 yellow 4 - ;Y
  21. 4 black 5 - ;K
  22. EOF
  23. gmt grdimage ID.nc -Cmask.cpt -Jx0.5i -O -Ba2f1 -BWSne -K -Y5i >> $ps
  24. gmt psxy -RID.nc -J -O -K @multihole.gmt -W0.25p,white >> $ps
  25. gmt psscale -Cmask.cpt -Dx5.75i/2i+w2i/0.15i+jML -O -Li0.05i >> $ps
Tip!

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

Comments

Loading...