Skip to content

Commit

Permalink
Solids table
Browse files Browse the repository at this point in the history
  • Loading branch information
joa-quim committed Oct 28, 2024
1 parent 80fd993 commit 86d0df1
Show file tree
Hide file tree
Showing 14 changed files with 124 additions and 19 deletions.
4 changes: 2 additions & 2 deletions _libs/lunr/lunr_index.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions documentation/all_docs_ref/all_refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ its use requires resorting to the \myreflink{Monolithic} mode.
| \myreflink{weather} | \myreflink{whereami} | \myreflink{wmsinfo} | \myreflink{wmsread} | \myreflink{wmstest} | \myreflink{worldrectgrid} | \myreflink{worldrectcoast} | \myreflink{worldrectangular} |
| \myreflink{xyzw2cube} | \myreflink{yeardecimal} | \myreflink{zonal_stats} | | | | | |

## Solids functions

{{ generate_tablerefs solids}}


## GDAL utility functions

Expand Down
26 changes: 21 additions & 5 deletions documentation/general/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The GMTgrid type is how grids, (geo)referenced or not, comunicate in/out with th
They implement the AbstractArray interface.

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

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

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

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

```julia
type GMTps
struct GMTps
postscript::String # Actual PS plot (text string)
length::Int # Byte length of postscript
mode::Int # 1 = Has header, 2 = Has trailer, 3 = Has both
comment::Vector{String} # Cell array with any comments
end
```

## Face-Vertices type

```julia
struct GMTfv{T<:AbstractFloat} <: AbstractMatrix{T}
verts::AbstractMatrix{T} # Mx3 Matrix with the data vertices
faces::Vector{<:AbstractMatrix{<:Integer}} # A vector of matrices with the faces. Each row is a face
faces_view::Vector{Matrix{Int}} # A subset of `faces` with only the visible faces from a certain perspective
bbox::Vector{Float64} # The vertices BoundingBox
zscale::Float64 # A multiplicative factor to scale the z values
bfculling::Bool # If culling of invisible faces is wished
proj4::String # Projection string in PROJ4 syntax (Optional)
wkt::String # Projection string in WKT syntax (Optional)
epsg::Int # EPSG projection code (Optional)
end
```
6 changes: 6 additions & 0 deletions documentation/modules/coast.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ painted and no land fill is set then the land-areas will be transparent. A map p
equivalent of the `borders` and `rivers` form **shore=(level,pen)** is not possible here because the parser cannot
tell if `shore=(2,:red)` means plot *level=2* in red or all levels with a line thicknes of 2 points and color `red`.

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

\textinput{common_opts/opt_X}

\textinput{common_opts/opt_Y}
Expand Down
14 changes: 14 additions & 0 deletions documentation/modules/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ Optional Arguments
the *z* value used for formatting is in the 4th, not 3rd column. Exceptionally, this option can
be broken up in its individual pieces by dropping the **attrib** keyword.

- **outline** : -- *outline=true* **|** *outline="thk,color"*\
Plots an outline arround the text. By setting **outline=true** we plot a 1 point white outline around
the text. To control the outline pen use the form "thickness,color". For example **outline="3p,red"**
adds a 3 points thickness red outline.

- **G** or **fill** : -- *fill=color* **|** *fill=:c*\
Sets the shade or color used for filling the text box [Default is no fill]. Alternatively, use **fill=:c** to plot
the text and then use the text dimensions (and **clearance**) to build clip paths and turn clipping on. This clipping
Expand Down Expand Up @@ -201,6 +206,15 @@ text(["Hello World"], x=2.0, y=2.0, show=true)
```
\end{examplefig}

A similar example but using the `outline` option to plot a 3 points green outline.

\begin{examplefig}{}
```julia
using GMT
text(["Hello World"], x=2.0, y=2.0, outline="3p,red", font=40, show=true)
```
\end{examplefig}

Example using the *rich* function (reproduces the original example in Makie).

\begin{examplefig}{}
Expand Down
5 changes: 5 additions & 0 deletions documentation/solids.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@def order = 99

# Solids functions

{{ solids_reference }}
12 changes: 12 additions & 0 deletions documentation/solids.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cube
cylinder
dodecahedron
extrude
fv2fv
icosahedron
octahedron
replicant
sphere
tetrahedron
torus
surf2fv
19 changes: 19 additions & 0 deletions documentation/utilities/mosaic.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ I = mosaic(G::Union{GMTgrid, GMTimage}; pt_radius=6371007.0, provider="", zoom::
I = mosaic(region=??, ..., kw...)
```

---

```julia
I = mosaic([zoom::Int=??])
```

*keywords: GMT, Julia, tiles image*

Expand Down Expand Up @@ -138,6 +143,20 @@ viz(D, coast=true)
```
\end{examplefig}

- Print a table with the zoom level 10 basic characteristics.

```julia
using GMT

mosaic(zoom=10)
┌───────┬────────────────┬────────────┬────────────────┬────────────────────┐
│ Level │ Tile width │ m / pixel │ ~Scale │ Examples of │
│ │ ° of longitude │ on Equator │ │ areas to represent │
├───────┼────────────────┼────────────┼────────────────┼────────────────────┤
100.352153.0541:500 thousand │ metropolitan area │
└───────┴────────────────┴────────────┴────────────────┴────────────────────┘
```

See Also
--------

Expand Down
25 changes: 21 additions & 4 deletions documentation/utilities/wmsread.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,31 @@ Read the `layer` number provided by the service from which the `wms` type was cr
both of these forms are allowed: `layer=3` or `layer="Invented layer name"`

### `kwargs` is the keywords/values pairs used to set
- `region | limits`: The region limits. This can be a Tuple or Array with 4 elements defining the `(xmin, xmax, ymin, ymax)`
or a string defining the limits in all ways that GMT can recognize. When the layer has the data projected, we can
a Tuple or Array with 3 elements `(lon0, lat0, width)`, where first two set the center of a square in geographical
coordinates and the third (`width`) is the width of that box in meters.
- `region | limits`: The region limits. Options are:
- A Tuple or Array with 4 elements defining the `(xmin, xmax, ymin, ymax)` or a string defining the
limits in all ways that GMT can recognize.

- When the layer has the data projected, we can pass a Tuple or Array with 3 elements `(lon0, lat0, width)`,
where first two set the center of a square in geographical coordinates and the third (`width`) is the
width of that box in meters.

- A ``mosaic`` tile name in the form ``X,Y,Z`` or a quadtree. Example: ``region="7829,6374,14"``. See the ``mosaic``
function manual for more information. This form also sets the default cellsize for that tile. NOTE:
this is a geographical coordinates only that implicitly sets ``geog=true``. See below on how to change
the default resolution.

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

- `zoom or refine`: When the region is derived from a ``mosaic`` tile name, the default is to get an image with 256 columns
and _n_ rows where _n_ depends on latitude. So, either the area is large and consequently the resolution is low, or
the inverse (small area and resolution is high). To change this status, use the `zoom` or `refine` options.
- `zoom`: an integer >= 1 that for each increment duplicates the base resolution by 2. _e.g._, `zoom=2`
quadruplicates the default resolution. This option is almost redundant with the `refine`, but is offered
for consistency with the ``mosaic`` function.
- `refine`: an integer >= 2 multiplication factor that is used to increment the resolution by factor. _e.g._, `refine=2`
duplicates the image resolution.

- `size`: Alternatively to the the `cellsize` use this option, a tuple or array with two elements, to specify
the image dimensions. Example, `size=(1200, 100)` to get an image with 1200 rows and 100 columns.

Expand Down
1 change: 0 additions & 1 deletion gallery/ex01.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ maps should show the continents in light brown in the background. This is how it
\begin{examplefig}{}
```julia
using GMT
GMT.resetGMT() # hide

subplot(grid=(2,1), region=:global, autolabel=true, margins=0.5,
title="Low Order Geoid", panel_size=(16,0), frame="lrtb", proj=:Hammer, figsize=16)
Expand Down
2 changes: 1 addition & 1 deletion gallery/ex18.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ av = grdvolume(Gtmp, cont=50, unit=:k);

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

text!(T, paragraph=true, fill=:white, pen=:thin, offset=0.75, font=(14,"Helvetica-Bold"),
justify=:LB, clearance=0.25, show=true)
Expand Down
6 changes: 3 additions & 3 deletions gallery/ex40.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ plot!("@GSHHS_h_Australia.txt", pen=:faint, fill=(240,255,240))
plot!("@GSHHS_h_Australia.txt", ms=0.025, fill=:red)
T500k = gmtsimplify("@GSHHS_h_Australia.txt", tolerance="500k");
t = gmtspatial("@GSHHS_h_Australia.txt", colinfo=:g, length=:k);
area = sprintf("Full area = %.0f km@+2@+", t.data[3]);
area = @sprintf("Full area = %.0f km@+2@+", t.data[3]);
t = gmtspatial(T500k, colinfo=:g, length=:k);
area_T500k = sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
area_T500k = @sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
plot!(T500k, pen=(1,:blue))
plot!(centroid, marker=:cross, ms=0.75, ml=3)
text!(text_record([112 -10], "T = 500 km"), offset=(away=true, shift=(0.25,0.25)), font=18, justify=:TL)
Expand All @@ -31,7 +31,7 @@ plot!("@GSHHS_h_Australia.txt", pen=:faint, fill=(240,255,240))
plot!("@GSHHS_h_Australia.txt", ms=0.025, fill=:red)
T100k = gmtsimplify("@GSHHS_h_Australia.txt", tolerance="100k");
t = gmtspatial(T100k, colinfo=:g, length=:k);
area_T100k = sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
area_T100k = @sprintf("Reduced area = %.0f km@+2@+", t.data[3]);
plot!(T100k, pen=(1,:blue))
plot!(centroid, marker=:cross, ms=0.75, ml=3)
text!(text_record([112 -10], "T = 100 km"), offset=(away=true, shift=(0.25,0.25)), font=18, justify=:TL)
Expand Down
12 changes: 9 additions & 3 deletions tutorials/remote_datasets/moon/moon.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ file name of the dataset to any grid plotting method if no CPT is explicitly spe
Refer to [moon_relief](https://www.generic-mapping-tools.org/remote-datasets/moon-relief.html) for more details
about technical detail, available resolutions, sizes, version information and references.

### Examples
### Example

A shaded relief of the Tycho Crater.

\begin{examplefig}{}
```julia
G = gmtread(remotegrid("moon", res="10m"))
viz(G, shade=true)
using GMT

G = gmtread(remotegrid("moon", res="14s"), region=(-14,-8.5,-45.25, -41.25))
viz(G, proj=:guess, shade=true)
```
\end{examplefig}
7 changes: 7 additions & 0 deletions utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ function hfun_utilfuns_reference()
join(map(html_docstring, names))
end

function hfun_solids_reference()
fid = open("documentation/solids.txt", "r")
names = readlines(fid)
close(fid)
join(map(html_docstring, names))
end

function hfun_supplements_reference()
fid = open("documentation/supplements.txt", "r")
names = readlines(fid)
Expand Down

0 comments on commit 86d0df1

Please sign in to comment.