buffergeo
buffergeo(D::GMTdataset; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=0.01)
or
buffergeo(line::Matrix; width=0, unit=:m, np=120, flatstart=false, flatend=false, proj::String="", epsg::Integer=0, tol=0.01)
or
buffergeo(fname::String; width=0, unit=:m, np=120, flatstart=false, flatend=false, proj::String="", epsg::Integer=0, tol=0.01)
Computes a buffer arround a poly-line. This calculation is performed on a ellipsoidal Earth (or other planet) using the GeographicLib (via PROJ4) so it should be very accurate.
Parameters
D|line| fname: - the geometry. This can either be a GMTdataset (or vector of it), a Mx2 matrix, the name of file that can be read as a GMTdataset bygmtread()or a GDAL AbstractDataset objectwidth: - the buffer width to be applied. Expressed meters (the default), km or Miles (seeunit)unit: - Ifwidthis not in meters use one ofunit=:km, orunit=:Nauticalorunit=:Milesnp: - Number of points into which circles are descretized (Default = 120)flatstart- When computing buffers arround poly-lines make the start flat (no half-circle)flatend- Same asflatstartbut for the buffer endproj- If line data is in Cartesians but with a known projection pass in a PROJ4 string to allow computing the bufferepsg- Same asprojbut using an EPSG codetol- At the end simplify the buffer line with a Douglas-Peucker procedure. Use TOL=0 to NOT do the line simplification, or use any other value in degrees. Default computes it as 0.5% of buffer width.
Returns
A GMT dataset or a vector of it (when input is Vector{GMTdataset})
Example: Compute a buffer with 50000 m width
D = buffergeo([0 0; 10 10; 15 20], width=50000);