Skip to main content
edited tags
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How do I keep the Keeping unique segmented treeID when exporting the .las file from R for loading into ArcGIS Pro

I want to export a .las file of segmented trees with the treeID column into ArcProArcGIS Pro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column treeID to ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for rename applied to an object of class c('LAS', 'Spatial').

library(lidR)
library(dplyr)

# Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
#  trying to rename the columns like you can in a dataframe
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
# using the pipe function
las1 %>% rename(treeID=ReturnNumber)

colnames(las1) 

# write out .las to file for loading into ArcPROArcGIS Pro
writeLAS(las = las1, file = "trees.las", index= TRUE)

How do I keep the unique segmented treeID when exporting the .las file

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column treeID to ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for rename applied to an object of class c('LAS', 'Spatial').

library(lidR)
library(dplyr)

# Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
#  trying to rename the columns like you can in a dataframe
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
# using the pipe function
las1 %>% rename(treeID=ReturnNumber)

colnames(las1) 

# write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)

Keeping unique segmented treeID when exporting .las file from R for loading into ArcGIS Pro

I want to export a .las file of segmented trees with the treeID column into ArcGIS Pro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column treeID to ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for rename applied to an object of class c('LAS', 'Spatial').

library(lidR)
library(dplyr)

# Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
#  trying to rename the columns like you can in a dataframe
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
# using the pipe function
las1 %>% rename(treeID=ReturnNumber)

colnames(las1) 

# write out .las to file for loading into ArcGIS Pro
writeLAS(las = las1, file = "trees.las", index= TRUE)
Became Hot Network Question
Tweeted twitter.com/StackGIS/status/1290482771547193348
deleted 5 characters in body; edited title
Source Link
JRR
  • 9.7k
  • 1
  • 14
  • 29

How do I keep the unique segmented treeID when exporting the .las file into ArcGIS Pro after using Rstudio running lidR tree segmentation

I want to export a .las file of segmented trees with the treeIDtreeID column into ArcPro, but when I export the file the treeIDtreeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeIDtreeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column "treeID"treeID to "ReturnNumber"ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for 'rename'rename applied to an object of class "c('LAS', 'Spatial')"c('LAS', 'Spatial').


 library(lidR)
library(dplyr)

#  Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
 
#  trying to rename the columns like you can in a dataframe
 
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
#using# using the pipe function
las1 %>% 
  rename(treeID=ReturnNumber)

colnames(las1) 

#  write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)

How do I keep the unique segmented treeID when exporting the .las file into ArcGIS Pro after using Rstudio running lidR tree segmentation

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column "treeID" to "ReturnNumber" but I can not find a way that works and generally receive an error message similar to "no applicable method for 'rename' applied to an object of class "c('LAS', 'Spatial')".


 library(lidR)
library(dplyr)

#  Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
 
#  trying to rename the columns like you can in a dataframe
 
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
#using the pipe function
las1 %>% 
  rename(treeID=ReturnNumber)

colnames(las1) 

#  write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)

How do I keep the unique segmented treeID when exporting the .las file

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column treeID to ReturnNumber but I can not find a way that works and generally receive an error message similar to "no applicable method for rename applied to an object of class c('LAS', 'Spatial').

library(lidR)
library(dplyr)

# Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)
#  trying to rename the columns like you can in a dataframe
select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
# using the pipe function
las1 %>% rename(treeID=ReturnNumber)

colnames(las1) 

# write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)
naming
Source Link
Vince
  • 20.3k
  • 16
  • 48
  • 65

How do I keep the unique segmented treeID when exporting the .las file into ArcPROArcGIS Pro after using Rstudio running lidR tree segmentation

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcPROArcGIS Pro, I was trying to rename or copy the column "treeID" to "ReturnNumber" but I can not find a way that works and generally receive an error message similar to "no applicable method for 'rename' applied to an object of class "c('LAS', 'Spatial')".


library(lidR)
library(dplyr)

#  Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)

#  trying to rename the columns like you can in a dataframe

select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
#using the pipe function
las1 %>% 
  rename(treeID=ReturnNumber)

colnames(las1) 

#  write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)

How do I keep the unique segmented treeID when exporting the .las file into ArcPRO after using Rstudio running lidR tree segmentation

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcPRO, I was trying to rename or copy the column "treeID" to "ReturnNumber" but I can not find a way that works and generally receive an error message similar to "no applicable method for 'rename' applied to an object of class "c('LAS', 'Spatial')".


library(lidR)
library(dplyr)

#  Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)

#  trying to rename the columns like you can in a dataframe

select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
#using the pipe function
las1 %>% 
  rename(treeID=ReturnNumber)

colnames(las1) 

#  write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)

How do I keep the unique segmented treeID when exporting the .las file into ArcGIS Pro after using Rstudio running lidR tree segmentation

I want to export a .las file of segmented trees with the treeID column into ArcPro, but when I export the file the treeID column is not selectable and I really want the separate colours for the segmented trees.

I have tried changing the name of the treeID row in R and/or copying the data into a recognised header name in ArcGIS Pro, I was trying to rename or copy the column "treeID" to "ReturnNumber" but I can not find a way that works and generally receive an error message similar to "no applicable method for 'rename' applied to an object of class "c('LAS', 'Spatial')".


library(lidR)
library(dplyr)

#  Import the las and segment the trees
LASfile <- system.file("extdata", "MixedConifer.laz", package="lidR")
las <- readLAS(LASfile, select = "xyzr", filter = "-drop_z_below 0")
las1 <- segment_trees(las, li2012())
col <- random.colors(200)
plot(las1, color = "treeID", colorPalette = col)

#  trying to rename the columns like you can in a dataframe

select(las1, treeID=ReturnNumber)
# or
temp <- mutate(las1, UserData=ReturnNumber(las1))
#using the pipe function
las1 %>% 
  rename(treeID=ReturnNumber)

colnames(las1) 

#  write out .las to file for loading into ArcPRO
writeLAS(las = las1, file = "trees.las", index= TRUE)
Source Link
Loading