The GeoMakie API

GeoMakie.AlbersEqualAreaMethod

AlbersEqualArea(; centrallongitude=0.0, centrallatitude=0.0, falseeasting=0.0, falsenorthing=0.0, standard_parallels=(20.0, 50.0) )

This projection is conic and equal-area, and is commonly used for maps of the conterminous United States.

Parameters

  • central_longitude: The central longitude. Defaults to 0.
  • central_latitude: The central latitude. Defaults to 0.
  • false_easting: X offset from planar origin in metres. Defaults to 0.
  • false_northing: Y offset from planar origin in metres. Defaults to 0.
  • standard_parallels: The one or two latitudes of correct scale. Defaults to (20, 50).
GeoMakie.MercatorMethod
Mercator(; central_longitude=0.0,
        latitude_true_scale=nothing, false_easting=0.0, false_northing=0.0,
        scale_factor=nothing, units = "m")

Parameters

  • central_longitude: The central longitude. Defaults to 0.
  • latitude_true_scale: The latitude where the scale is 1. Defaults to 0 degrees.
  • false_easting: X offset from the planar origin in metres. Defaults to 0.
  • false_northing: Y offset from the planar origin in metres. Defaults to 0.
  • scale_factor: Scale factor at natural origin. Defaults to unused.
Note

Only one of $latitude_true_scale$ and $scale_factor$ should be included.

GeoMakie.RobinsonMethod
Robinson(; central_longitude=0.0, false_easting=0.0, false_northing=0.0, units = "m")

The Robinson projection is the successor of the van der Grinten series of projections, and was created specifically for the purpose of world mapping.

Parameters

  • central_longitude: The central longitude. Defaults to 0.
  • false_easting: X offset from planar origin in metres. Defaults to 0.
  • false_northing: Y offset from planar origin in metres. Defaults to 0.
GeoMakie.TransverseMercatorMethod
TransverseMercator(; central_longitude=0.0, central_latitude=0.0, false_easting=0.0, false_northing=0.0, scale_factor=1.0, units = "m")

Parameters

  • central_longitude: The true longitude of the central meridian in degrees. Defaults to 0.
  • central_latitude: The true latitude of the planar origin in degrees. Defaults to 0.
  • false_easting: X offset from the planar origin in metres. Defaults to 0.
  • false_northing: Y offset from the planar origin in metres. Defaults to 0.
  • scale_factor: Scale factor at the central meridian. Defaults to 1.
GeoMakie.UTMFunction

UTM(zone, southern_hemisphere=false; units = "m")

Parameters

zone: The numeric zone of the UTM required. southern_hemisphere: Set to True if the zone is in the southern hemisphere. Defaults to False.

GeoMakie.WinkelTripelMethod

WinkelTripel(; centrallongitude = 0, firstparallel = 0, falseeasting=0, falsenorthing=0, units = "m")

The Winkel tripel projection was the successor of the Robinson projection, and minimizes the triplet (tripel) of distortions: area, direction, and distance.

GeoMakie.earthMethod
earth(; kwargs...)

Plots an image of the Earth in the given projection.

GeoMakie.rec_pointMethod

Recursively convert every element in the collection to a Point2f0.

GeoMakie.rec_projectMethod

Recurses through the given structure until it reaches a Point2f0, then projects it.

GeoMakie.xygridMethod
xygrid(lons::Vector, lats::Vector; projection = LatLon()) -> (x::Matrix, y::Matrix)

Generates a grid of x and y coordinates in lat-lon space from the given ranges.

Optionally, also projects them into the specified CRS before returning them.

Note

Materializing the matrices is necessary for C-interoperability, since passing the matrix to C implies that it can't be stored lazily and generated on the fly.

GeoMakie.WilkinsonTicksType
WilkinsonTicks(; kwargs...)

This is basically Wilkinson's ad-hoc scoring method that tries to balance tight fit around the data, optimal number of ticks, and simple numbers.

This is the function which Plots.jl and Makie.jl use by default.

Keyword Arguments

  • extend_ticks

    Determines whether to extend tick computation. Defaults to false.

  • strict_span

    True if no ticks should be outside [x_min, x_max]. Defaults to true.

  • Q

    A distribution of nice numbers from which labellings are sampled. Stored in the form (number, score).

  • k_min

    The minimum number of ticks.

  • k_max

    The maximum number of ticks.

  • k_ideal

    The ideal number of ticks.

  • granularity_weight

    Encourages returning roughly the number of labels requested.

  • simplicity_weight

    Encourages nicer labeling sequences by preferring step sizes that appear earlier in Q.

    Also rewards labelings that include 0 as a way to ground the sequence.

  • coverage_weight

    Encourages labelings that do not extend far beyond the range of the data, penalizing unnecessary whitespace.

  • niceness_weight

    Encourages labellings to produce nice ranges.

Mathematical details

Wilkinson’s optimization function is defined as the sum of three components. If the user requests m labels and a possible labeling has k labels, then the components are simplicity, coverage and granularity.

These components are defined as follows:

\[\begin{aligned} &\text{simplicity} = 1 - \frac{i}{|Q|} + \frac{v}{|Q|}\\ &\text{coverage} = \frac{x_{max} - x_{min}}{\mathrm{label}_{max} - \mathrm{label}_{min}}\\ &\text{granularity}= 1 - \frac{\left|k - m\right|}{m} \end{aligned}\]

and the variables here are:

  • q: element of Q.
  • i: index of q in Q.
  • v: 1 if label range includes 0, 0 otherwise.
source
GeoMakie.gridpointsMethod
gridpoints(xs, ys)

Returns a Vector of Points of a grid formed by xs and ys.

GeoMakie.img2colorvecMethod
img2colorvec(img)

Converts a matrix to a vector with the correct form for mesh coloring.

GeoMakie.impreciseMethod
imprecise(arr)

Returns true if the polygon is invalid when converted to Float32, and false otherwise.

GeoMakie.nonzeroMethod
nonzero(pt::Point{2, T}) where T

Returns true if both of the elements are nonzero, and false otherwise.

GeoMakie.toMeshesMethod
toMeshes(mp::Vector{Vector{Vector{Point2}}})::Vector{GLNormalUVMesh}
toMeshes(p::Vector{Vector{Point2}})::Vector{GLNormalUVMesh}

Takes in a polygon, or a multipolygon, and returns a vector of meshes (which may only contain one mesh).

GeoMakie.toPointVecsMethod
toPointVecs(mp::MultiPolygon)

Creates a vector of vectors of Points from the given MultiPolygon. Returns a Vector{Vector{Point}}.

Warning

There is no support for holes in this function at present; that will need to wait for GeometryBasics.jl to become complete, possibly replacing GeoInterface.

GeoMakie.toPointVecsMethod
toPointVecs(poly::Polygon)

Creates a vector of Points from the given polygon. Returns a Vector{Vector{Point}}, with one element.

GeoMakie.to_nansep_vecMethod
to_nansep_vec([f::Function,] data::Vector{Vector{T}};
    outtype = Point2f0, length_of_data = sum(length.(data)) + length(data)
)

Flattens the given Vector of Vectors into a single Vector, while inserting NaN separations between each individual sub- vector.

If f is given, then f will be executed on each subvector before it is merged into the main vector. If it is not, the data will remain unchanged (i.e., f is just identity).

GeoMakie.triangulated_gridMethod
triangulated_grid(xs, ys) -> points, faces

Takes in two ranges, and returns a triangulated regular grid based on those ranges.

GeoMakie.wrap_lonMethod
wrap_lon(x)

Wraps the input longitude (or Vector of longitudes) into the domain (-180, 180).

Proj4._transform!Method

Low level interface to libproj transform, C_NULL can be passed in for z, if it's 2-dimensional