Skip to content

Commit 86d0df1

Browse files
committed
Solids table
1 parent 80fd993 commit 86d0df1

File tree

14 files changed

+124
-19
lines changed

14 files changed

+124
-19
lines changed

_libs/lunr/lunr_index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

documentation/all_docs_ref/all_refs.md

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ its use requires resorting to the \myreflink{Monolithic} mode.
5555
| \myreflink{weather} | \myreflink{whereami} | \myreflink{wmsinfo} | \myreflink{wmsread} | \myreflink{wmstest} | \myreflink{worldrectgrid} | \myreflink{worldrectcoast} | \myreflink{worldrectangular} |
5656
| \myreflink{xyzw2cube} | \myreflink{yeardecimal} | \myreflink{zonal_stats} | | | | | |
5757

58+
## Solids functions
59+
60+
{{ generate_tablerefs solids}}
61+
5862

5963
## GDAL utility functions
6064

documentation/general/types.md

+21-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The GMTgrid type is how grids, (geo)referenced or not, comunicate in/out with th
66
They implement the AbstractArray interface.
77

88
```julia
9-
type GMTgrid{T<:Real,N} <: AbstractArray{T,N} # The type holding a local header and data of a GMT grid
9+
struct GMTgrid{T<:Real,N} <: AbstractArray{T,N} # The type holding a local header and data of a GMT grid
1010
proj4::String # Projection string in PROJ4 syntax (Optional)
1111
wkt::String # Projection string in WKT syntax (Optional)
1212
epsg::Int # EPSG code
@@ -39,7 +39,7 @@ end
3939
## Image type
4040

4141
```julia
42-
type GMTimage{T<:Unsigned, N} <: AbstractArray{T,N} # The type holding a local header and data of a GMT image
42+
struct GMTimage{T<:Unsigned, N} <: AbstractArray{T,N} # The type holding a local header and data of a GMT image
4343
proj4::String # Projection string in PROJ4 syntax (Optional)
4444
wkt::String # Projection string in WKT syntax (Optional)
4545
epsg::Int # EPSG code
@@ -67,7 +67,7 @@ end
6767
## Dataset type
6868

6969
```julia
70-
type GMTdataset{T<:Real, N} <: AbstractArray{T,N}
70+
struct GMTdataset{T<:Real, N} <: AbstractArray{T,N}
7171
data::Array{T,N} # Mx2 Matrix with segment data
7272
ds_bbox::Vector{Float64} # Global BoundingBox (for when there are many segments)
7373
bbox::Vector{Float64} # Segment BoundingBox
@@ -86,7 +86,7 @@ end
8686
## CPT type
8787

8888
```julia
89-
type GMTcpt
89+
struct GMTcpt
9090
colormap::Array{Float64,2} # Mx3 matrix equal to the first three columns of cpt
9191
alpha::Array{Float64,1} # Vector of alpha values. One for each color.
9292
range::Array{Float64,2} # Mx2 matrix with z range for each slice
@@ -106,10 +106,26 @@ end
106106
## Postscript type
107107

108108
```julia
109-
type GMTps
109+
struct GMTps
110110
postscript::String # Actual PS plot (text string)
111111
length::Int # Byte length of postscript
112112
mode::Int # 1 = Has header, 2 = Has trailer, 3 = Has both
113113
comment::Vector{String} # Cell array with any comments
114114
end
115115
```
116+
117+
## Face-Vertices type
118+
119+
```julia
120+
struct GMTfv{T<:AbstractFloat} <: AbstractMatrix{T}
121+
verts::AbstractMatrix{T} # Mx3 Matrix with the data vertices
122+
faces::Vector{<:AbstractMatrix{<:Integer}} # A vector of matrices with the faces. Each row is a face
123+
faces_view::Vector{Matrix{Int}} # A subset of `faces` with only the visible faces from a certain perspective
124+
bbox::Vector{Float64} # The vertices BoundingBox
125+
zscale::Float64 # A multiplicative factor to scale the z values
126+
bfculling::Bool # If culling of invisible faces is wished
127+
proj4::String # Projection string in PROJ4 syntax (Optional)
128+
wkt::String # Projection string in WKT syntax (Optional)
129+
epsg::Int # EPSG projection code (Optional)
130+
end
131+
```

documentation/modules/coast.md

+6
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ painted and no land fill is set then the land-areas will be transparent. A map p
118118
equivalent of the `borders` and `rivers` form **shore=(level,pen)** is not possible here because the parser cannot
119119
tell if `shore=(2,:red)` means plot *level=2* in red or all levels with a line thicknes of 2 points and color `red`.
120120

121+
- **Z** : -- *Z=true* **|** *Z=grid*\
122+
Add a third column to the **dump** option (**Z** is ignored if **dump** is not set). This third column will be filled
123+
with zeros when **Z=true** or it interpolates the grid _grid_ (a file name or a \myreflink{GMTgrid} object) with
124+
\myreflink{grdrack} at the locations of the coastline. This is particularly useful if one wants to drape a coastline
125+
on top of a \myreflink{grdview} plot.
126+
121127
\textinput{common_opts/opt_X}
122128

123129
\textinput{common_opts/opt_Y}

documentation/modules/text.md

+14
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ Optional Arguments
102102
the *z* value used for formatting is in the 4th, not 3rd column. Exceptionally, this option can
103103
be broken up in its individual pieces by dropping the **attrib** keyword.
104104

105+
- **outline** : -- *outline=true* **|** *outline="thk,color"*\
106+
Plots an outline arround the text. By setting **outline=true** we plot a 1 point white outline around
107+
the text. To control the outline pen use the form "thickness,color". For example **outline="3p,red"**
108+
adds a 3 points thickness red outline.
109+
105110
- **G** or **fill** : -- *fill=color* **|** *fill=:c*\
106111
Sets the shade or color used for filling the text box [Default is no fill]. Alternatively, use **fill=:c** to plot
107112
the text and then use the text dimensions (and **clearance**) to build clip paths and turn clipping on. This clipping
@@ -201,6 +206,15 @@ text(["Hello World"], x=2.0, y=2.0, show=true)
201206
```
202207
\end{examplefig}
203208

209+
A similar example but using the `outline` option to plot a 3 points green outline.
210+
211+
\begin{examplefig}{}
212+
```julia
213+
using GMT
214+
text(["Hello World"], x=2.0, y=2.0, outline="3p,red", font=40, show=true)
215+
```
216+
\end{examplefig}
217+
204218
Example using the *rich* function (reproduces the original example in Makie).
205219

206220
\begin{examplefig}{}

documentation/solids.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@def order = 99
2+
3+
# Solids functions
4+
5+
{{ solids_reference }}

documentation/solids.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cube
2+
cylinder
3+
dodecahedron
4+
extrude
5+
fv2fv
6+
icosahedron
7+
octahedron
8+
replicant
9+
sphere
10+
tetrahedron
11+
torus
12+
surf2fv

documentation/utilities/mosaic.md

+19
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ I = mosaic(G::Union{GMTgrid, GMTimage}; pt_radius=6371007.0, provider="", zoom::
2525
I = mosaic(region=??, ..., kw...)
2626
```
2727

28+
---
29+
30+
```julia
31+
I = mosaic([zoom::Int=??])
32+
```
2833

2934
*keywords: GMT, Julia, tiles image*
3035

@@ -138,6 +143,20 @@ viz(D, coast=true)
138143
```
139144
\end{examplefig}
140145

146+
- Print a table with the zoom level 10 basic characteristics.
147+
148+
```julia
149+
using GMT
150+
151+
mosaic(zoom=10)
152+
┌───────┬────────────────┬────────────┬────────────────┬────────────────────┐
153+
│ Level │ Tile width │ m / pixel │ ~Scale │ Examples of │
154+
│ │ ° of longitude │ on Equator │ │ areas to represent │
155+
├───────┼────────────────┼────────────┼────────────────┼────────────────────┤
156+
100.352153.0541:500 thousand │ metropolitan area │
157+
└───────┴────────────────┴────────────┴────────────────┴────────────────────┘
158+
```
159+
141160
See Also
142161
--------
143162

documentation/utilities/wmsread.md

+21-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,31 @@ Read the `layer` number provided by the service from which the `wms` type was cr
1515
both of these forms are allowed: `layer=3` or `layer="Invented layer name"`
1616

1717
### `kwargs` is the keywords/values pairs used to set
18-
- `region | limits`: The region limits. This can be a Tuple or Array with 4 elements defining the `(xmin, xmax, ymin, ymax)`
19-
or a string defining the limits in all ways that GMT can recognize. When the layer has the data projected, we can
20-
a Tuple or Array with 3 elements `(lon0, lat0, width)`, where first two set the center of a square in geographical
21-
coordinates and the third (`width`) is the width of that box in meters.
18+
- `region | limits`: The region limits. Options are:
19+
- A Tuple or Array with 4 elements defining the `(xmin, xmax, ymin, ymax)` or a string defining the
20+
limits in all ways that GMT can recognize.
21+
22+
- When the layer has the data projected, we can pass a Tuple or Array with 3 elements `(lon0, lat0, width)`,
23+
where first two set the center of a square in geographical coordinates and the third (`width`) is the
24+
width of that box in meters.
25+
26+
- A ``mosaic`` tile name in the form ``X,Y,Z`` or a quadtree. Example: ``region="7829,6374,14"``. See the ``mosaic``
27+
function manual for more information. This form also sets the default cellsize for that tile. NOTE:
28+
this is a geographical coordinates only that implicitly sets ``geog=true``. See below on how to change
29+
the default resolution.
2230

2331
- `cellsize | pixelsize | resolution | res`: Sets the requested cell size in meters [default]. Use a string appended with a 'd'
2432
(e.g. `resolution="0.001d"`) if the resolution is given in degrees. This way works only when the layer is in geogs.
2533

34+
- `zoom or refine`: When the region is derived from a ``mosaic`` tile name, the default is to get an image with 256 columns
35+
and _n_ rows where _n_ depends on latitude. So, either the area is large and consequently the resolution is low, or
36+
the inverse (small area and resolution is high). To change this status, use the `zoom` or `refine` options.
37+
- `zoom`: an integer >= 1 that for each increment duplicates the base resolution by 2. _e.g._, `zoom=2`
38+
quadruplicates the default resolution. This option is almost redundant with the `refine`, but is offered
39+
for consistency with the ``mosaic`` function.
40+
- `refine`: an integer >= 2 multiplication factor that is used to increment the resolution by factor. _e.g._, `refine=2`
41+
duplicates the image resolution.
42+
2643
- `size`: Alternatively to the the `cellsize` use this option, a tuple or array with two elements, to specify
2744
the image dimensions. Example, `size=(1200, 100)` to get an image with 1200 rows and 100 columns.
2845

gallery/ex01.md

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ maps should show the continents in light brown in the background. This is how it
1111
\begin{examplefig}{}
1212
```julia
1313
using GMT
14-
GMT.resetGMT() # hide
1514

1615
subplot(grid=(2,1), region=:global, autolabel=true, margins=0.5,
1716
title="Low Order Geoid", panel_size=(16,0), frame="lrtb", proj=:Hammer, figsize=16)

gallery/ex18.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ av = grdvolume(Gtmp, cont=50, unit=:k);
5757

5858
T = mat2ds(["Volumes: $(av.data[3]) mGal\\264km@+2@+"
5959
""
60-
sprintf("Areas: %.2f km@+2@+", av.data[2])], hdr="> -149 52.5 14p 2.6i j")
60+
@sprintf("Areas: %.2f km@+2@+", av.data[2])], hdr="> -149 52.5 14p 2.6i j")
6161

6262
text!(T, paragraph=true, fill=:white, pen=:thin, offset=0.75, font=(14,"Helvetica-Bold"),
6363
justify=:LB, clearance=0.25, show=true)

gallery/ex40.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ plot!("@GSHHS_h_Australia.txt", pen=:faint, fill=(240,255,240))
1818
plot!("@GSHHS_h_Australia.txt", ms=0.025, fill=:red)
1919
T500k = gmtsimplify("@GSHHS_h_Australia.txt", tolerance="500k");
2020
t = gmtspatial("@GSHHS_h_Australia.txt", colinfo=:g, length=:k);
21-
area = sprintf("Full area = %.0f km@+2@+", t.data[3]);
21+
area = @sprintf("Full area = %.0f km@+2@+", t.data[3]);
2222
t = gmtspatial(T500k, colinfo=:g, length=:k);
23-
area_T500k = sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
23+
area_T500k = @sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
2424
plot!(T500k, pen=(1,:blue))
2525
plot!(centroid, marker=:cross, ms=0.75, ml=3)
2626
text!(text_record([112 -10], "T = 500 km"), offset=(away=true, shift=(0.25,0.25)), font=18, justify=:TL)
@@ -31,7 +31,7 @@ plot!("@GSHHS_h_Australia.txt", pen=:faint, fill=(240,255,240))
3131
plot!("@GSHHS_h_Australia.txt", ms=0.025, fill=:red)
3232
T100k = gmtsimplify("@GSHHS_h_Australia.txt", tolerance="100k");
3333
t = gmtspatial(T100k, colinfo=:g, length=:k);
34-
area_T100k = sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
34+
area_T100k = @sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
3535
plot!(T100k, pen=(1,:blue))
3636
plot!(centroid, marker=:cross, ms=0.75, ml=3)
3737
text!(text_record([112 -10], "T = 100 km"), offset=(away=true, shift=(0.25,0.25)), font=18, justify=:TL)

tutorials/remote_datasets/moon/moon.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ file name of the dataset to any grid plotting method if no CPT is explicitly spe
2525
Refer to [moon_relief](https://www.generic-mapping-tools.org/remote-datasets/moon-relief.html) for more details
2626
about technical detail, available resolutions, sizes, version information and references.
2727

28-
### Examples
28+
### Example
2929

30+
A shaded relief of the Tycho Crater.
31+
32+
\begin{examplefig}{}
3033
```julia
31-
G = gmtread(remotegrid("moon", res="10m"))
32-
viz(G, shade=true)
34+
using GMT
35+
36+
G = gmtread(remotegrid("moon", res="14s"), region=(-14,-8.5,-45.25, -41.25))
37+
viz(G, proj=:guess, shade=true)
3338
```
39+
\end{examplefig}

utils.jl

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ function hfun_utilfuns_reference()
5252
join(map(html_docstring, names))
5353
end
5454

55+
function hfun_solids_reference()
56+
fid = open("documentation/solids.txt", "r")
57+
names = readlines(fid)
58+
close(fid)
59+
join(map(html_docstring, names))
60+
end
61+
5562
function hfun_supplements_reference()
5663
fid = open("documentation/supplements.txt", "r")
5764
names = readlines(fid)

0 commit comments

Comments
 (0)