CTFS.quadfunctions {CTFS} | R Documentation |
A series of functions that convert from one form of location to another, such as from a tree coordinate (gx, gy) to a quadrate, from a quadrate to a row and col index, etc.
FUNCTIONS FOR CONVERTING AMONG INDEX, COORDINATES AND QUADRATES
rowcol.to.index | Converts a Row and Column to a Quadrate Number |
index.to.rowcol | Converts a Quadrate Number (Indext) to Row and Column Numbers |
gxgy.to.index | Converts GX GY Coordinates to a Quadrate Number |
index.to.gxgy | Converts a Quadrate Number to GX GY Coordinates |
gxgy.to.rowcol | Converts a GX GY Coordinates to Row and Column Numbers |
gxgy.to.hectindex | Converts GX GY Coordinates to a Hectare Number |
findborderquads | Returns Indices of Neighboring Quadrats Given a Quadrat Index |
PLOT LAYOUT
The standard plot is 1000 by 500 m, running West to East and South to North, like the conventional cooridnates of a graph.
The 0,0 corner and edge going from 0,0 to 0,500 and going from
0,0 to 1000,0 are included in the plot. The outer edges, going from
500,0 to 1000,500 and 1000,0 to 1000,500 are NOT included in the
plot. This holds true for any portion of the plot.
Therefore, hectare 1 includes the sides 0,0 to 0,100 and 0,0 to
100,0 but NOT 100,0 to 100,100 and 100,0 to 100,100.
Quadrate 1 includes sides 0,0 to 0,20 and 0,0 to 20, 0 but NOT 20,0
to 20,20 and 0,20 to 20,20.
The convention is 20 by 20 m quadrates, 1250 of them in a 1000 by 500 m plot. The convention is to number the quadrates starting in the southwest corner and going northward up a "column" of 25, and returning to the southern border for 26-50, etc:
These function should work for any 4 sided plot, square or rectangular. But the dimension of the plot if different from 1000, 500 must be provided for each function.
Quadrate Number, Index
25 | 50 | 75 ... | 1250 |
24 | 49 | 74 ... | 1249 |
. | . | . ... | . |
. | . | . ... | . |
. | . | . ... | . |
3 | 28 | 53 ... | 1228 |
2 | 27 | 52 ... | 1227 |
1 | 26 | 51 ... | 1226 |
Rows and Columns
cols
1 | 2 | 3 ... | 48 | 49 | 50 |
rows
25 | ... |
24 | ... |
. | ... |
. | ... |
. | ... |
2 | ... |
1 | ... |
Hectare Number, Index
5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 |
4 | 9 | 14 | 19 | 24 | 29 | 34 | 39 | 44 | 49 |
3 | 8 | 13 | 18 | 23 | 28 | 33 | 38 | 43 | 48 |
2 | 7 | 12 | 17 | 22 | 27 | 32 | 37 | 42 | 47 |
1 | 6 | 11 | 16 | 21 | 26 | 31 | 36 | 41 | 46 |
DEFINITIONS
plotdim=c(1000,500)
gridsize=20
for a quadrate and
gridsize=100
for a hectare
gxgy.to.hectindex
has a fixed gridsize=100
but it gives
the same result as using gxgy.to.index
with gridsize=100
.
EXAMPLES
Examples of how to use these functions, showing the relationship between index, rowcol, gxgy, and hectindex.
index.to.rowcol(43) row col 1 18 2 index.to.gxgy(43) gx gy 1 20 340 gxgy.to.index(20,340) [1] 43 rowcol.to.index(18,2) [1] 43 gxgy.to.rowcol(20,340) row col 1 18 2 gxgy.to.hectindex(20,340) [1] 4 gxgy.to.index(1000,500) [1] NA
Rick Condit, Suzanne Lao and Pamela Hall
CTFS.groupcats
,
CTFS.readwrite
, CTFS.utilities