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

[2.1.5] lasmergespatial fails for non-in-memory RasterStack #306

Closed
spono opened this issue Dec 12, 2019 · 2 comments
Closed

[2.1.5] lasmergespatial fails for non-in-memory RasterStack #306

spono opened this issue Dec 12, 2019 · 2 comments
Assignees
Labels
Bug A bug in the package
Milestone

Comments

@spono
Copy link

spono commented Dec 12, 2019

I want to colorise a point cloud with a RasterStack

las = readLAS('clip_2019.laz', select='xyz')
crs(las) = sp::CRS('+init=epsg:32632')

r = stack('orthoimage.tif')
crs(r) = sp::CRS('+init=epsg:32632')

las = lasmergespatial(las, r)

but I get the following warning:

Warning messages:
1: In max(R, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
2: In max(G, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
3: In max(B, na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf

The RGB columns are added to las but they contain only NAs.

> head(las)
          X       Y        Z  R  G  B
1: 729978.2 5149051 1512.568 NA NA NA
2: 729978.5 5149051 1519.967 NA NA NA
3: 729979.0 5149051 1512.729 NA NA NA
4: 729979.0 5149051 1512.828 NA NA NA
5: 729979.1 5149051 1512.847 NA NA NA
6: 729979.3 5149051 1512.745 NA NA NA

Everything works fine when I force the load with readAll, as proposed in the post mentioned in bug report #285 .

> head(las)
          X       Y        Z     R     G     B
1: 729978.2 5149051 1512.568 30069 31868 22616
2: 729978.5 5149051 1519.967 30326 32125 23130
3: 729979.0 5149051 1512.729 29555 31354 22359
4: 729979.0 5149051 1512.828 29298 31354 22102
5: 729979.1 5149051 1512.847 28527 30840 21588
6: 729979.3 5149051 1512.745 27499 30326 21074
@Jean-Romain Jean-Romain self-assigned this Dec 12, 2019
@Jean-Romain Jean-Romain added the Bug A bug in the package label Dec 12, 2019
@Jean-Romain Jean-Romain added this to the v2.2.0 milestone Dec 12, 2019
Jean-Romain added a commit that referenced this issue Dec 12, 2019
@Jean-Romain
Copy link
Collaborator

Fixed in 2.2.0 because 2.1.5 won't be released.

@Jean-Romain
Copy link
Collaborator

Fixed also in 2.1.5 btw

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