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
29
  1. #!/bin/bash
  2. # $Id$
  3. #
  4. # Test gmt grdmask for proper handling of perimeter and holes [OGR].
  5. ps=ogrtest.ps
  6. # 1. make a regular mask from a perimeter+hole file
  7. 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
  8. cat << EOF > mask.cpt
  9. 0 blue 1 -
  10. 1 green 2 -
  11. 2 red 3 -
  12. EOF
  13. gmt grdimage mask.nc -Cmask.cpt -Jx800id -P -Ba10sf5s -BWSne -K -Xc > $ps
  14. gmt psxy -Rmask.nc -J -O -K pentagon.gmt -W0.25p,white >> $ps
  15. # 2. make an ID grid from a multipolygon file with IDs set to CPT entries
  16. gmt grdmask -R-3/8/-3/5 -I0.1 -r multihole.gmt -aZ=ID -Nz -GID.nc -fg
  17. cat << EOF > mask.cpt
  18. 0 blue 1 - ;B
  19. 1 green 2 - ;G
  20. 2 red 3 - ;R
  21. 3 yellow 4 - ;Y
  22. 4 black 5 - ;K
  23. EOF
  24. gmt grdimage ID.nc -Cmask.cpt -Jx0.5i -O -Ba2f1 -BWSne -K -Y5i >> $ps
  25. gmt psxy -RID.nc -J -O -K multihole.gmt -W0.25p,white >> $ps
  26. gmt psscale -Cmask.cpt -D5.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...