Generates a grid of points in a polygon (M.A. Mugglestone, S.A. Harding, B.Y.Y. Lee, P.J. Diggle & B.S. Rowlingson).
|What to print (
||Vertical coordinates of each polygon; no default – this parameter must be set|
||Horizontal coordinates of each polygon; no default – this parameter must be set|
||How many points to generate|
||Spacings to use between columns of the grid|
||Spacings to use between rows of the grid|
||Variates to receive the vertical coordinates of the points in the grid|
||Variates to receive the horizontal coordinates of the points in the grid|
This procedure generates a grid of points in a polygon specified by the parameters
YPOLYGON. The size of the grid may be specified in either of two ways. The first method is to specify the total number of points to be generated using the parameter
NPOINTS. The value supplied for
NPOINTS must be a positive integer. This method will produce a square grid, the number of rows and columns being approximately equal to
SQRT(NPOINTS). The second method is to specify the required spacing between rows and columns of the grid using the parameters
YSTEP. The values supplied for
YSTEP should be on the scale of the coordinates of the polygon. If the parameter
NPOINTS is set then any values specified for
YSTEP will be ignored. The coordinates of the points which are generated may be saved using the parameters
Printed output is controlled by the
summary prints the horizontal and vertical coordinates of the points in the grid under the headings
PTCHECKXY is called to check that
YPOLYGON have identical restrictions.
PTBOX is used to calculate the bounding box for the polygon specified by
YPOLYGON. A grid of points spanning the bounding box is created according to the settings of
NPOINTS (appropriately scaled to produce the equivalent density of points on the bounding box),
YSTEP. Any points which fall outside the specified polygon are then removed using
YPOLYGON are restricted, only the subset of values specified by the restriction will be included in the calculations.
Commands for: Spatial statistics.
CAPTION 'PTGRID example'; STYLE=meta VARIATE xpoly; VALUES=!(0,1,1,0) & ypoly; VALUES=!(0,0,1,1) PTGRID YPOLYGON=ypoly; XPOLYGON=xpoly; NPOINTS=16