Description Usage Arguments Details Value Author(s) See Also Examples
Draws a BAS sample from a SpatialLines* object.
1 | bas.line(x, n, balance = "1D", init.n.factor = 10)
|
x |
A |
n |
Sample size. Number of locations to draw from the set of all lines
contained in |
balance |
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
in |
init.n.factor |
If If one desires an underlying grid spaced w meters apart, 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 controlled
by init.n.factor. After
discretization of the line, points are selected
using 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 n fall
inside the squares surrounding discretization points. When a
Halton
point falls in a square, the square is selected and the
sample location is the center of the square (which falls somewhere on the
original lines).
A 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. If BAS order is lost, return[ order(
return$sampleID ),] will resort the
returned object (i.e., return) into BAS order.
geometryID: The ID of the line in x on which each
sample point falls. The
ID of lines in x are row.names(x).
Any attributes of the original lines (in x).
Additional attributes of the output object, beyond those which
make it a SpatialPointsDataFrame, are:
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.
If balance=="1D", this is a single uniform random
integer between 0 and maxU. If balance=="2D", this is
a vector of two uniform random
integers between 0 and maxU.
bas.bbox: If balance=="2D", this is the
bounding box surrounding x
used to scale Halton points. The scaled Halton sequence is
bas.bbox[,"min"]+ t(halton(n,2,random.start))*
rep(max( diff(t(bas.bbox))), 2).
If balance=="1D", this is a vector containing the 1D
bounding box. Lower limit of the 1D bounding box is 0. Upper
limit of the 1D box is the total
length of 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 halton(n,1, random.start)*
bas.bbox[2] because bas.bbox[1] is zero.
Trent McDonald
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.