circgeo
function vecangles(lonlat0::VMr, lonlat1::Matrix{<:Real}; proj::String=““, s_srs::String=”“, epsg::Integer=0, sorted=true) az = invgeod(lonlat1, [lonlat0[1] lonlat0[2]]; proj=proj, s_srs=s_srs, backward=true)[3] [(az[k] < 0) && (az[k] += 360) for k = 1:lastindex(az)] if (sorted) p = sortperm(az) sort!(az) else p = collect(1:length(az)) end difas = append!(diff(az), [az[1] - az[end]].+360) return difas, p end
————————————————————————————————-
““” circgeo(lon, lat; radius=X, proj=““, s_srs=”“, epsg=0, dataset=false, unit=:m, np=120, shape=”“) Or
circgeo(lonlat; radius=X, proj="", s_srs="", epsg=0, dataset=false, unit=:m, np=120, shape="")
Compute a geographical circle (and other shapes) in geographical or in projected coordinates.
Args
lonlat: - longitude, latitude (degrees). If a Mx2 matrix, returns as many segments as number of rows. Use this to compute multiple shapes at different positions. In this case output type is always a vector of GMTdatasets.
Kwargs
radius: - The circle radius in meters (but seeunit) or circumscribing circle for the other shapesprojors_srs: - the given projection whose ellipsoid we move along. Can be a proj4 string or an WKTepsg: - Alternative way of specifying the projection [Default is WGS84]dataset: - If true returns a GMTdataset instead of matrix (with single shapes)unit: - Ifradiusis not in meters use one ofunit=:km, orunit=:Nauticalorunit=:Milesnp: - Number of points into which the circle is descretized (Default = 120)shape: - Optional string/symbol with “triangle”, “square”, “pentagon” or “hexagon” (or just the first char) to compute one of those geometries instead of a circle.npis ignored in these cases.
Returns
- circ - A Mx2 matrix or GMTdataset with the circle coordinates
Example:
Compute a circle about the (0,0) point with a radius of 50 km
c = circgeo([0. 0], radius=50, unit=:k)