World Map

SatelliteAnalysis.jl has a built-in algorithm to plot the World Map provided that the user loaded GeoJSON.jl and one of the Makie.jl backends. This empty plot can be used to add analysis on top of it. We can create it using the function plot_world_map:

SatelliteAnalysis.plot_world_mapFunction
plot_world_map(; kwargs...) -> Figure, Axis

Create a Makie.jl Figure and Axis with the world map. The figure is styled with the theme obtained from the function SatelliteAnalysis.makie_theme, selected by the keyword theme. All other kwargs... are passed to the function Figure. For more information, please refer to Makie.jl documentation.

Note

This function plots the countries' borders in the created figure using the file with the country polygons fetched with the function fetch_country_polygons. Hence, if this file does not exist, the algorithm tries to download it.

Warning

This function only works after loading the package GeoJSON.jl and one Makie.jl backend (CairoMakie.jl or GLMakie.jl, for example).

Keywords

  • theme::Union{Nothing, Symbol, Makie.Theme}: Theme used to style the figure, which is applied locally. If it is a Symbol, it selects the variant of the theme created by the function SatelliteAnalysis.makie_theme, which can be :light or :dark. If it is a Makie.Theme, this theme is applied. If it is nothing, no theme is applied, and the figure uses the current Makie theme. In the last two cases, the elements that are not styled by the theme use the colors of the variant :light. (Default: :light)
  • size::Tuple: Size of the figure. (Default: (1450, 800))

Extended help

Throws

  • ArgumentError: If the theme variant in theme is not :dark or :light.
source
SatelliteAnalysis.plot_world_map!Function
plot_world_map!(ax::Axis; kwargs...) -> Poly

Plot the country polygons of the world map in the Makie.jl axis ax, in which the X-axis is the longitude [°] and the Y-axis is the latitude [°], returning the created plot. This function does not change the axis limits, ticks, or labels.

Note

This function plots the countries' borders using the file with the country polygons fetched with the function fetch_country_polygons. Hence, if this file does not exist, the algorithm tries to download it.

Note

Since this function draws into an existing axis, it does not apply the theme provided by the function SatelliteAnalysis.makie_theme. The plot inherits the styling of the figure that owns ax.

Warning

This function only works after loading the package GeoJSON.jl and one Makie.jl backend (CairoMakie.jl or GLMakie.jl, for example).

Keywords

  • theme::Union{Nothing, Symbol, Makie.Theme}: Select the colors of the country polygons, which are not styled by the Makie theme. If it is :dark or :light, we use the colors of the respective variant of the theme provided by SatelliteAnalysis.makie_theme. If it is a Makie.Theme or nothing, we use the colors of the light variant. (Default: :light)

All other kwargs... are passed to the function poly!, overriding the attributes selected by this function (color, strokecolor, and strokewidth).

Extended help

Throws

  • ArgumentError: If theme is a Symbol other than :dark or :light.
source
julia> using GeoJSON, CairoMakie
julia> fig, ax = plot_world_map();

World Map

We can also create the World map using the dark theme variant:

fig, ax = plot_world_map(; theme = :dark)

World Map (Dark)