randinpolygon

D = randinpolygon(Din; density=0.1, np::Int=0)

Generate random samples inside polygons. The method used here is that of poin-in-polygon. That is, we generate random points inside a rectangular BoundingBox of each polygon and retain those inside the polygon. For geographical polygons we generate random angles but do NOT connect the polygon sides with great circles, so solution is not really geographic but the error is rather small if the polygon vertices are close to each other.

Returns

A GMTdatset if only one polygon was passed or a Vector{GMTaset} otherwise.

Methods

# 2 methods for generic function "randinpolygon" from GMT:
 [1] randinpolygon(Din::GDtype; density, np)
 [2] randinpolygon(mat::Matrix{<:AbstractFloat}; density, np)

See Also