LAS에서 EPSG 코드를 설정할 수 없음-lidR
Sep 30 2020
EPSG 2226에서 EPSG 6418로 LAZ 파일을 재 투영하려고합니다.
재 투영이 잘 작동하지만 (다음을 따랐습니다 : LidR에서 LAS 파일을 재 투영 할 수 있습니까? ) LAS 헤더에 정보를 저장할 수 없으며 이후에 LAS 파일을 저장하고 R 환경에서 벗어날 수 있습니다. CRS가 손실됩니다.
이 LAZ 파일 다운로드
아래 코드를 사용했습니다.
library(lidR)
las_tmp <- readLAS("./USGS_LPC_CA_Sonoma_2013_SOCO_0054_108_LAS_2017.laz")
las_tmp_reproj <- spTransform(las_tmp, sp::CRS("+init=epsg:6418"))
#> Warning messages:
#> 1: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
#> Discarded datum NAD83_National_Spatial_Reference_System_2011 in CRS definition
#> 2: In sp::proj4string(x) : CRS object has comment, which is lost in output
#> 3: EPSG code not found: header not updated. Try to use the function epsg() manually to ensure CRS will be written in file.
#> 4: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
#> Discarded datum Unknown based on GRS80 ellipsoid in CRS definition
가 말했듯이 warnings()수 3 EPSG 코드를 찾을 수 없습니다 및 헤더는하지 업데이트되었습니다. 팁을 따라 다음 명령을 시도했습니다.
epsg(las_tmp_reproj) <- as.integer(6418)
#> Warning message:
#> In showSRID(SRS_string, format = "PROJ", multiline = "NO") :
#> Discarded datum NAD83_National_Spatial_Reference_System_2011 in CRS definition
불행히도이 단계 후에 epsg 정보에 액세스 epsg(las_tmp_reproj)하면 다음 오류가 발생합니다.
epsg(ctg_tmp_reproj)
#> Error in if (tags[[i]]$key == 3072) return(i) :
#> l'argument est de longueur nulle
데이텀 자체와 관련이 있습니까? 오류 메시지는 실제로 명시 적이 지 않으며 꽤 갇혀 있습니다.
답변
3 JRR Sep 30 2020 at 04:16
실제로 버그를 발견했습니다. 나는 그것을 epsg (x) : Error in if (tags [[i]] $ key == 3072) return (i) : l' argument est de longueur nulle로보고했습니다 . 이 버그는 패키지에서 발생합니다 rlas. 버전 1.3.7에서 수정되었습니다. CRAN 출시 전에 문제를 해결하려면 rlasGithub에서 설치할 수 있습니다.
remotes::install_github("Jean-Romain/rlas")