Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epsg(x) : Error in if (tags[[i]]$key == 3072) return(i): l'argument est de longueur nulle #48

Closed
Jean-Romain opened this issue Sep 29, 2020 · 1 comment
Assignees

Comments

@Jean-Romain
Copy link
Collaborator

library(lidR)
las_tmp <- readLAS("~/Téléchargements/USGS_LPC_CA_Sonoma_2013_SOCO_0054_108_LAS_2017.laz", filter = "-keep_random_fraction 0.01")
epsg(las_tmp)
#> [1] 2226
las_tmp_reproj <- spTransform(las_tmp, sp::CRS("+init=epsg:6418"))
#> Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded
#> datum NAD83_National_Spatial_Reference_System_2011 in CRS definition
#> Warning in sp::proj4string(x): CRS object has comment, which is lost in output
#> Warning: EPSG code not found: header not updated. Try to provide the ESPG code
#> instead of a CRS
epsg(las_tmp_reproj) = 6148
#> Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
#> datum European_Terrestrial_Reference_System_1989 in CRS definition
epsg(las_tmp_reproj)
#> Error in if (tags[[i]]$key == 3072) return(i): l'argument est de longueur nulle

Created on 2020-09-29 by the reprex package (v0.3.0)

@Jean-Romain Jean-Romain self-assigned this Sep 29, 2020
@Jean-Romain
Copy link
Collaborator Author

Jean-Romain commented Sep 29, 2020

Minimal reproducible example

LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
header <- rlas::read.lasheader(LASfile)
header$`Variable Length Records`$GeoKeyDirectoryTag$tags[[2]] <- NULL
header <- rlas::header_set_epsg(header, 6148) #> 3 NULL introduced

@Jean-Romain Jean-Romain transferred this issue from r-lidar/lidR Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant