colorzones!

colorzones!(shapes::Vector{GMTdataset}[, fun::Function]; img::GMTimage=nothing,
              url::AbstractString="", layer=0, pixelsize::Int=0, append::Bool=true)

Paint the polygons in the shapes with the average color that those polygons ocupy in the img image. When the shapes are plotted the resulting image looks like a choropleth map. Alternatively, instead of transmitting the img image one can provide a WMS URL, layer number and pixelsize to download images from the Web Map Server service, covering each one the bounding box of each of the shapes polygons. This option is much slower than passing the entire image at once but consumes much less memory. Important when the total area is large (think Russia size) because even at a moderately resultion it can imply downloading a huge file.

Returns

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

Examples

Read the 2020 Sentinel2 Earth color for Portugal at 100 m resolution. Load the administrative regions and compute their median colors.

wms = wmsinfo("http://tiles.maps.eox.at/wms?");
img = wmsread(wms, layer=3, region=(-9.6,-6,36.9,42.2), pixelsize=100);
Pt = gmtread("C:/programs/compa_libs/covid19pt/extra/mapas/concelhos/concelhos.shp");
colorzones!(Pt, median, img=img);
imshow(Pt, proj=:guess)

See Also

[rasterzones!], gmtread, wmsinfo, wmsread

Source Code

This function has multiple methods: