Skip to contents

Attribute GPS coordinates to trees

Usage

attributeTreeCoord(xy, plot, dim, coordAbs)

Arguments

xy

The relative coordinates of the trees within each plot

plot

The label of the plot (same length as the number of rows of xy or length of 1)

dim

The dimension of the plot (either one value if the plot is a square or a vector if a rectangle)

coordAbs

The result of the function cutPlot() or numberCorner()

Value

A data frame with two columns: - Xproj: The X coordinates in the absolute coordinate system - Yproj: The Y coordinates in the absolute coordinate system

Examples


# Trees relative coordinates
xy <- data.frame(x = runif(200, min = 0, max = 200), y = runif(200, min = 0, max = 200))


# cut the plot in multiple part
coord <- data.frame(X = rep(c(0, 200, 0, 200), 2), Y = rep(c(0, 0, 200, 200), 2))
coord[1:4, ] <- coord[1:4, ] + 5000
coord[5:8, ] <- coord[5:8, ] + 6000
corner <- rep(c(1, 2, 4, 3), 2)
Forestplot <- rep(c("plot1", "plot2"), each = 4)

Outcut <- cutPlot(coord, Forestplot, corner, gridsize = 100, dimX = 200, dimY = 200)
#> Warning: 'cutPlot()' has been replaced by `divide_plot()` and will be removed in the next version.
#> Please see the vignette `Spatialized trees and forest stand metrics with BIOMASS`


# Assign a plot to 200 trees
Forestplot <- rep(c("plot1", "plot2"), 100)

# attribute trees to subplots
attributeTreeCoord(xy, Forestplot, dim =100,coordAbs = Outcut)
#> Warning: 'attributeTreeCoord()' is deprecated and will be removed in the next version. The projected tree coordinates are now retrieved by the `check_plot_coord()` function
#> Please see the vignette `Spatialized trees and forest stand metrics with BIOMASS`
#>        Xproj    Yproj
#> 1   5008.835 5088.143
#> 2   6179.018 6042.892
#> 3   5151.306 5147.002
#> 4   6095.633 6068.102
#> 5   5096.927 5063.651
#> 6   6084.518 6105.389
#> 7   5196.865 5036.936
#> 8   6198.113 6150.666
#> 9   5166.549 5145.377
#> 10  6023.114 6097.853
#> 11  5060.084 5040.029
#> 12  6116.742 6119.784
#> 13  5131.931 5087.647
#> 14  6185.601 6003.773
#> 15  5004.024 5040.612
#> 16  6106.645 6060.872
#> 17  5082.551 5138.873
#> 18  6155.580 6016.514
#> 19  5015.527 5121.356
#> 20  6039.405 6177.680
#> 21  5114.933 5065.944
#> 22  6020.264 6096.299
#> 23  5158.465 5099.467
#> 24  6138.018 6108.825
#> 25  5126.354 5197.868
#> 26  6029.010 6152.983
#> 27  5137.937 5052.985
#> 28  6065.170 6158.257
#> 29  5194.667 5081.021
#> 30  6145.179 6048.164
#> 31  5120.565 5080.836
#> 32  6093.450 6109.903
#> 33  5164.520 5069.814
#> 34  6173.970 6062.262
#> 35  5018.340 5196.269
#> 36  6030.853 6039.083
#> 37  5019.657 5135.411
#> 38  6087.411 6074.602
#> 39  5084.760 5197.328
#> 40  6179.810 6190.161
#> 41  5139.655 5040.345
#> 42  6003.350 6163.093
#> 43  5181.712 5170.556
#> 44  6179.749 6105.113
#> 45  5023.763 5045.406
#> 46  6173.854 6122.827
#> 47  5103.498 5172.003
#> 48  6129.366 6118.202
#> 49  5131.481 5191.043
#> 50  6077.915 6088.752
#> 51  5155.728 5037.956
#> 52  6066.749 6023.780
#> 53  5028.881 5091.182
#> 54  6042.316 6075.868
#> 55  5128.182 5049.533
#> 56  6017.867 6124.426
#> 57  5111.313 5107.801
#> 58  6058.520 6063.612
#> 59  5154.185 5141.434
#> 60  6160.596 6032.823
#> 61  5056.706 5047.031
#> 62  6104.743 6184.084
#> 63  5085.677 5025.855
#> 64  6117.283 6059.874
#> 65  5060.168 5089.519
#> 66  6181.480 6173.845
#> 67  5184.794 5064.150
#> 68  6183.827 6024.706
#> 69  5090.813 5182.722
#> 70  6074.180 6073.301
#> 71  5085.399 5152.728
#> 72  6189.424 6003.514
#> 73  5016.562 5100.408
#> 74  6178.319 6141.866
#> 75  5041.663 5074.091
#> 76  6052.846 6104.616
#> 77  5121.294 5079.900
#> 78  6024.693 6052.376
#> 79  5113.074 5168.817
#> 80  6180.495 6027.526
#> 81  5151.581 5074.794
#> 82  6004.009 6169.118
#> 83  5121.936 5156.979
#> 84  6179.544 6167.932
#> 85  5022.809 5172.258
#> 86  6087.794 6199.489
#> 87  5026.206 5173.432
#> 88  6044.608 6012.028
#> 89  5158.864 5181.596
#> 90  6134.653 6026.168
#> 91  5070.014 5107.231
#> 92  6014.761 6100.685
#> 93  5183.751 5084.792
#> 94  6174.424 6000.674
#> 95  5113.197 5188.214
#> 96  6107.187 6142.129
#> 97  5071.601 5196.785
#> 98  6039.890 6172.282
#> 99  5147.740 5122.117
#> 100 6122.901 6096.172
#> 101 5070.654 5008.817
#> 102 6086.189 6132.855
#> 103 5174.091 5195.699
#> 104 6185.937 6040.027
#> 105 5118.276 5112.675
#> 106 6180.947 6187.691
#> 107 5197.692 5141.985
#> 108 6016.709 6060.359
#> 109 5080.534 5017.592
#> 110 6150.580 6082.330
#> 111 5019.982 5022.049
#> 112 6022.498 6004.338
#> 113 5124.318 5159.125
#> 114 6020.023 6106.865
#> 115 5065.401 5137.763
#> 116 6196.907 6109.905
#> 117 5108.154 5194.123
#> 118 6199.260 6037.800
#> 119 5128.538 5124.671
#> 120 6153.411 6004.794
#> 121 5113.339 5150.426
#> 122 6133.258 6092.237
#> 123 5030.443 5007.412
#> 124 6092.011 6027.382
#> 125 5027.313 5156.649
#> 126 6017.239 6157.920
#> 127 5020.803 5129.899
#> 128 6140.670 6096.036
#> 129 5084.532 5042.776
#> 130 6157.695 6186.153
#> 131 5073.971 5071.387
#> 132 6176.024 6091.612
#> 133 5159.437 5187.249
#> 134 6078.725 6056.643
#> 135 5121.963 5087.991
#> 136 6057.897 6164.026
#> 137 5105.919 5173.174
#> 138 6168.303 6144.012
#> 139 5153.163 5054.710
#> 140 6037.706 6138.035
#> 141 5167.521 5102.153
#> 142 6127.009 6171.452
#> 143 5131.913 5192.977
#> 144 6172.370 6186.470
#> 145 5169.645 5100.354
#> 146 6013.171 6033.997
#> 147 5019.181 5070.975
#> 148 6185.000 6066.213
#> 149 5075.416 5084.909
#> 150 6012.820 6032.873
#> 151 5018.950 5053.169
#> 152 6168.044 6090.653
#> 153 5190.995 5072.946
#> 154 6192.304 6133.736
#> 155 5124.997 5029.613
#> 156 6007.143 6109.656
#> 157 5131.724 5036.488
#> 158 6002.990 6001.507
#> 159 5094.275 5014.560
#> 160 6146.762 6138.600
#> 161 5071.194 5195.109
#> 162 6026.884 6037.334
#> 163 5090.179 5120.338
#> 164 6008.675 6044.365
#> 165 5082.159 5133.183
#> 166 6106.716 6035.862
#> 167 5167.925 5140.411
#> 168 6057.013 6002.164
#> 169 5060.940 5111.402
#> 170 6139.592 6186.633
#> 171 5176.981 5072.097
#> 172 6166.932 6187.152
#> 173 5151.638 5165.374
#> 174 6079.662 6045.754
#> 175 5051.275 5177.501
#> 176 6170.958 6116.920
#> 177 5126.755 5143.727
#> 178 6085.147 6034.320
#> 179 5188.294 5163.040
#> 180 6002.547 6133.206
#> 181 5160.786 5154.684
#> 182 6138.333 6127.756
#> 183 5083.115 5191.990
#> 184 6164.356 6111.548
#> 185 5080.623 5019.661
#> 186 6070.548 6116.773
#> 187 5125.007 5001.894
#> 188 6063.554 6168.687
#> 189 5160.114 5131.921
#> 190 6096.885 6106.561
#> 191 5054.341 5040.364
#> 192 6128.836 6188.745
#> 193 5152.038 5080.583
#> 194 6042.467 6011.623
#> 195 5110.991 5042.171
#> 196 6136.168 6177.581
#> 197 5112.976 5022.478
#> 198 6049.388 6129.331
#> 199 5082.340 5187.601
#> 200 6087.498 6061.079