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

grdgdal.rst 4.1 KB

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  1. .. index:: ! grdgdal
  2. .. include:: module_core_purpose.rst_
  3. *******
  4. grdgdal
  5. *******
  6. |grdgdal_purpose|
  7. Synopsis
  8. --------
  9. .. include:: common_SYN_OPTs.rst_
  10. **gmt grdgdal** *infile*
  11. |-A|\ *prog*\ [**+m**\ *method*\ **+c**\ *cpt*]
  12. |-G|\ *outfile*
  13. [ |-F|\ "*gd opts*"]
  14. [ |-M|\ [**+r+w**]]
  15. [ |SYN_OPT-R| ]
  16. [ |SYN_OPT-V| ]
  17. [ |SYN_OPT-bi| ]
  18. [ |SYN_OPT-d| ]
  19. [ |SYN_OPT-e| ]
  20. [ |SYN_OPT-g| ]
  21. [ **-hi** ]
  22. [ |SYN_OPT-i| ]
  23. [ |SYN_OPT-qi| ]
  24. [ |SYN_OPT-r| ]
  25. [ |SYN_OPT--| ]
  26. |No-spaces|
  27. Description
  28. -----------
  29. Wrapper module to run some of the GDAL programs (currently *gdalinfo*, *gdaldem*, *gdal_grid*, *gdal_translate*,
  30. *gdal_rasterize*, and *gdalwarp*) from within GMT. Given that GMT and GDAL syntaxes are very different, this module
  31. offers a minimal set of GMT style options but the bulk of them, which use the original GDAL syntax, are passed via
  32. a **-F**\ "*gdal options*". So, users are requested to consult the GDAL programs documentation to learn how to use it.
  33. When writing grids, an option is offered to write them either using the GMT or the GDAL machinery. Each one has
  34. its pros and cons. For example, saving with GMT allows the access by external libraries (*e.g.* Matlab, Julia, Python)
  35. but it requires to make a copy of the saving array. So saving with GDAL may be more efficient but looses the
  36. goodies provided by GMT (but gain its own).
  37. Required Arguments
  38. ------------------
  39. *infile*
  40. Name of an ASCII [or binary, see **-bi**] or an OGR file for programs taking table data, or a 2-D grid file
  41. for the other cases. File format for grids is detected automatically, but for ingesting OGR formats **-M+r**
  42. must be used.
  43. .. _-A:
  44. **-A**\ *prog*\ [**+m**\ *method*\ **+c**\ *cpt*]
  45. Select which GDAL program to run (currently one of *info*, *dem*, *grid*, *rasterize*, *translate* or *warp*).
  46. When program is *dem* then please append **+m**\ *method* (pick one of *hillshade*, *color-relief*, *slope*, *TRI*, *TPI*
  47. or *roughness*) and, for *color-relief*, you also need to specify a colormap with **+c**\ *cpt_name*.
  48. .. _-G:
  49. **-G**\ *outfile*
  50. Output file name. *outfile* is the name of the output grid (or image) file. When saving images, the GDAL machinery is picked by default.
  51. Optional Arguments
  52. ------------------
  53. .. _-F:
  54. **-F**\ "*gdal opts*"
  55. List of GDAL options for the selected program in -A wrapped in double quotes.
  56. .. _-M:
  57. **-M**\ [**+r+w**]
  58. Read and write files via GDAL. **-M** alone selects both reading and writing with GDAL.
  59. Option **-M+r** alone instructs the program to read with GDAL (and save with GMT). This option is needed when reading
  60. OGR vector data. **-M+w** indicates that the output will be saved with GDAL.
  61. .. _-R:
  62. .. |Add_-R| replace:: Using the **-R** option
  63. will select a subsection of the grid. If this subsection exceeds the
  64. boundaries of the grid, only the common region will be output.
  65. .. include:: explain_-R.rst_
  66. .. _-V:
  67. .. |Add_-V| unicode:: 0x20 .. just an invisible code
  68. .. include:: explain_-V.rst_
  69. .. |Add_-bi| replace:: [Default is 3]. This option
  70. only applies to xyz input via GMT.
  71. .. include:: explain_-bi.rst_
  72. .. |Add_-d| unicode:: 0x20 .. just an invisible code
  73. .. include:: explain_-d.rst_
  74. .. |Add_-e| unicode:: 0x20 .. just an invisible code
  75. .. include:: explain_-e.rst_
  76. .. |Add_-g| unicode:: 0x20 .. just an invisible code
  77. .. include:: explain_-g.rst_
  78. .. |Add_-h| replace:: Not used with binary data.
  79. .. include:: explain_-h.rst_
  80. .. include:: explain_-icols.rst_
  81. .. include:: explain_-qi.rst_
  82. .. |Add_nodereg| unicode:: 0x20 .. just an invisible code
  83. .. include:: explain_nodereg.rst_
  84. .. include:: explain_colon.rst_
  85. .. include:: explain_help.rst_
  86. Examples
  87. --------
  88. To interpolate the x,y,z data at 0.05 increment in a VRT file using the nearest neighbor algorithm
  89. and saving the result as a netCDF::
  90. gmt grdgdal lixo.vrt -Agrid -R0/10/0/10 -Gjunk.nc -I0.05 -F"-a nearest" -M+r
  91. Now the same as above but saving the grid with GDAL and using the x,y,z point file directly::
  92. gmt grdgdal lixo.csv -Agrid -R0/10/0/10 -Gjunk.nc -I0.05 -F"-a nearest" -M+w
  93. See Also
  94. --------
  95. :doc:`gmt.conf`,
  96. :doc:`gmt`
Tip!

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

Comments

Loading...