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

categorical.sh 611 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
  1. #!/usr/bin/env bash
  2. # Test a categorical CPT with text keys on a shapefile using
  3. # the aspatial field NAME via the CPT to yield pen color
  4. ps=categorical.ps
  5. # Get an OGR file from test cache and convert to shapefile
  6. test_data=`gmt which -Gl @RidgeTest.gmt`
  7. ogr2ogr -f "ESRI Shapefile" RidgeTest.shp $test_data
  8. # Make a text-based categorical cpt file
  9. cat << EOF > ridge.cpt
  10. Reykjanes red
  11. Klitgord green
  12. Dietmar blue
  13. EOF
  14. gmt psxy -R-40/-25/30/45 -JM6i -P -Baf RidgeTest.shp -aZ=NAME -Cridge.cpt -K -Xc > $ps
  15. gmt psxy -R -J -O -Sc0.2i -Cridge.cpt << EOF >> $ps
  16. -37 33 Dietmar
  17. -32 38 Klitgord
  18. -30 42 Reykjanes
  19. EOF
Tip!

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

Comments

Loading...