Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ outDir <- "C:/Plot2Map/results"
dataDir <- "C:/Plot2Map/data"
flDir <- 'C:/GFCFolder' #should be outside the main directory because GFC tiles will be downloaded here

SRS <- CRS('+init=epsg:4326')
SRS <- st_crs(4326)

## Set forest threshold into FAO-suggested 10% and above tree cover
forestTHs <- 10
Expand Down
6 changes: 3 additions & 3 deletions scripts/Nested.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Nested <- function(centroid_shp, tree_table){
cent.sf <- st_as_sf(centroid_shp)
cent.wgs <- spTransform(centroid_shp, CRS("+init=epsg:4326")) #to WGS84
cent.wgs <- st_transform(centroid_shp, st_crs(4326)) #to WGS84
pol <- st_buffer(cent.sf, 5.64) #square buffer approx. 1km resolution

plotTree0 <- subset(tree_table, tree_table$TREE_ALIVE == 1 &
Expand All @@ -30,8 +30,8 @@ Nested <- function(centroid_shp, tree_table){
plotTree$height)
}

cent.wgs$x <-cent.wgs@coords[,1]
cent.wgs$y <- cent.wgs@coords[,2]
cent.wgs$x <- st_coordinates(cent.wgs)[, 1]
cent.wgs$y <- st_coordinates(cent.wgs)[, 2]

xyTree <- left_join(plotTree, as.data.frame(cent.wgs), by=c('id'='POINT_GUID'))
xyTree <- xyTree[,c('id', 'y', 'x')]
Expand Down