The GeoMakie API
GeoMakie.WilkinsonTicks
GeoMakie.AlbersEqualArea
GeoMakie.LonLat
GeoMakie.Mercator
GeoMakie.Robinson
GeoMakie.TransverseMercator
GeoMakie.UTM
GeoMakie.WinkelTripel
GeoMakie.coastlines
GeoMakie.coastlines
GeoMakie.earth
GeoMakie.earth
GeoMakie.grid_triangle_faces
GeoMakie.gridpoints
GeoMakie.img2colorvec
GeoMakie.imprecise
GeoMakie.nonzero
GeoMakie.rec_point
GeoMakie.rec_project
GeoMakie.toMeshes
GeoMakie.toPointVecs
GeoMakie.toPointVecs
GeoMakie.to_nansep_vec
GeoMakie.triangulated_grid
GeoMakie.wrap_lon
GeoMakie.xygrid
Proj4._transform!
GeoMakie.AlbersEqualArea
— MethodAlbersEqualArea(; 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.LonLat
— MethodLonLat()
Standard latitude-longitude grid.
GeoMakie.Mercator
— MethodMercator(; 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.
Only one of $latitude_true_scale$ and $scale_factor$ should be included.
GeoMakie.Robinson
— MethodRobinson(; 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.TransverseMercator
— MethodTransverseMercator(; 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.UTM
— FunctionUTM(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.WinkelTripel
— MethodWinkelTripel(; 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.coastlines
— Methodcoastlines(; kwargs...)
Plot coastlines along the world.
GeoMakie.earth
— Methodearth(; kwargs...)
Plots an image of the Earth in the given projection.
GeoMakie.rec_point
— MethodRecursively convert every element in the collection to a Point2f0.
GeoMakie.rec_project
— MethodRecurses through the given structure until it reaches a Point2f0, then projects it.
GeoMakie.xygrid
— Methodxygrid(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.
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.WilkinsonTicks
— TypeWilkinsonTicks(; 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 totrue
.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:
and the variables here are:
q
: element ofQ
.i
: index ofq
inQ
.v
: 1 if label range includes 0, 0 otherwise.
GeoMakie.grid_triangle_faces
— Methodgrid_triangle_faces(lats, lons)
Returns a series of triangle indices from naive triangulation.
GeoMakie.gridpoints
— Methodgridpoints(xs, ys)
Returns a Vector of Points of a grid formed by xs and ys.
GeoMakie.img2colorvec
— Methodimg2colorvec(img)
Converts a matrix to a vector with the correct form for mesh coloring.
GeoMakie.imprecise
— Methodimprecise(arr)
Returns true
if the polygon is invalid when converted to Float32, and false
otherwise.
GeoMakie.nonzero
— Methodnonzero(pt::Point{2, T}) where T
Returns true
if both of the elements are nonzero, and false
otherwise.
GeoMakie.toMeshes
— MethodtoMeshes(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.toPointVecs
— MethodtoPointVecs(mp::MultiPolygon)
Creates a vector of vectors of Point
s from the given MultiPolygon. Returns a Vector{Vector{Point}}
.
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.toPointVecs
— MethodtoPointVecs(poly::Polygon)
Creates a vector of Point
s from the given polygon. Returns a Vector{Vector{Point}}
, with one element.
GeoMakie.to_nansep_vec
— Methodto_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_grid
— Methodtriangulated_grid(xs, ys) -> points, faces
Takes in two ranges, and returns a triangulated regular grid based on those ranges.
GeoMakie.wrap_lon
— Methodwrap_lon(x)
Wraps the input longitude (or Vector of longitudes) into the domain (-180, 180)
.
Proj4._transform!
— MethodLow level interface to libproj transform, C_NULL can be passed in for z, if it's 2-dimensional