rasterzones!

rasterzones!(GI::GItype, shapes::Vector{GMTdataset}, fun::Function)

Apply a unidimensional function fun to to the elements of the grid or image GI that lies inside the polygons of the GMTdataset shapes. The GI array is modified in place.

Returns

It does’t return anything but the input GI is modified.

Examples

Take the Peaks grid and replace the elements that fall inside a triangle at the center by their average.

using GMT

G = GMT.peaks();
D = mat2ds([-1 -1; 0 1; 1 -1; -1 -1]);
rasterzones!(G, D, mean)
viz(G)

See Also

[colorzones!]