Draws a BAS sample from a
bas.line(x, n, balance = "1D", init.n.factor = 10)
Sample size. Number of locations to draw from the set of all lines
Option specifying how spatial balance is maintained. The options are "1D" or "2D".
Under "1D" all lines in
Under "2D" a systematic sample of points along the union of all lines
If one desires an underlying grid spaced w meters appart, set
If a "1D" sample is requested, spatial balance is maintained on the lines when laid end-to-end in the order they appear. Points far apart in 1 dimension may be close together in 2 dimensions, and vice versa. Thus the sample may not look spatially balanced on a 2D map. This is a true infinite sample in that any of an infinite number of points along the lines could be selected.
If a "2D" BAS sample is requested, spatial balance is maintained
in 2 dimensions. Points are well balance on a 2D map. This is
done by discretization of lines with a dense systematic
sample of points (with
random start) where density of the systematic points is controled
discretization of the line, points are selected
bas.point. The BAS method for points places
a small square (pixel) around each and samples the set of squares
using the BAS method for polygons (see
bas.polygon). The BAS
method of polygons computes Halton points until
inside the squares surrounding discretization points. When a
point falls in a square, the square is selected and the
sample location is the center of the square (which falls somewhere on the
SpatialPointsDataFrame containing locations in the BAS sample,
in BAS order.
Attributes of the sample points are:
sampleID: A unique identifier for every sample point. This
encodes the BAS order.
return[order(return$sampleID),] will sort the
returned object in BAS order.
geometryID: The ID of the line in
x on which each
sample point falls. The
ID of lines in
Any attributes of the original lines (in
Additional attributes of the output object, beyond those which
make it a
frame: Name of the input sampling frame.
frame.type: Type of resource in sampling frame. (i.e., "line").
sample.type: Type of sample drawn. (i.e., "BAS").
balance: The type of balance ("1d" or "2d").
random.start: The random seed for the random-start
1D or 2D Halton sequence
that produced the sample.
balance=="1D", this is a single uniform random
integer between 0 and
balance=="2D", this is
a vector of two uniform random
integers between 0 and
balance=="2D", this is the square
bounding box surrounding
used to scale Halton points. A scaled Halton sequence of n points
used to sample points on the lines of
bas.bbox[,"min"] + t(halton(n,2,random.start)) *
rep( max(diff(t(bas.bbox))), 2).
balance=="1D", this is a vector containing the 1D
bounding box. The 1D bounding box is 0 to the total
length of all lines in
x. In this case, Halton points
are scaled as
bas.bbox[,"min"] + halton(n,1,random.start) *
diff(bas.bbox) which is equivalent to
bas.bbox is zero in this case.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.