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

Error in fast_quantization(las@data[["Z"]], zscale, zoffset) #571

Closed
cingularities opened this issue Apr 19, 2022 · 4 comments
Closed

Error in fast_quantization(las@data[["Z"]], zscale, zoffset) #571

cingularities opened this issue Apr 19, 2022 · 4 comments
Assignees
Labels
Bug A bug in the package

Comments

@cingularities
Copy link

cingularities commented Apr 19, 2022

Running normalized height.

AGL <- normalize_height(canopy_points, DTM, na.rm = TRUE, copy=TRUE)

Error:

Error in fast_quantization(las@data[["Z"]], zscale, zoffset) : 
  Non quantizable value outside the range of representable values of type 'int'

I already loaded the file using filter = "-drop_class 7"

lidR version: 4.0.0. Data

@Jean-Romain
Copy link
Collaborator

Can you investigate to reduce the problem to a smaller file/area. Downloading 3 GB will take me hours and I can't load such big file on my computer. And you did non share the DTM. If you computed the DTM with rasterize_terrain() please share a minimal reproducible example.

@cingularities
Copy link
Author

cingularities commented Apr 20, 2022

https://drive.google.com/drive/folders/12Z-vexz_cRNlgkHZLhkv9YIPxNu-_xQ7?usp=sharing
Here you go.
Folder includes canopy points and DTM

@Jean-Romain
Copy link
Collaborator

Jean-Romain commented Apr 20, 2022

Reproduced with

library(lidR)
library(terra)
setwd("~/lidR issues/issue 571/")

dtm = rast("DTM_042022.tif")
las = readLAS("canopy_points_042022.las")
nlas <- normalize_height(las, dtm*1)

Notice that na.rm is no longer useful since v4.0.0 and copy,as far as I can remember, never existed. Anyway it does not change anything to the issue.

@Jean-Romain Jean-Romain self-assigned this Apr 20, 2022
@Jean-Romain Jean-Romain added the Bug A bug in the package label Apr 20, 2022
@Jean-Romain
Copy link
Collaborator

The Z scale factor is not set to 0 when normalizing. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the package
Projects
None yet
Development

No branches or pull requests

2 participants