Skip to content

Error message while computing spectral indices #6

Closed
@mej1d1

Description

I created a raster stack (landsat_data) with 6 layers, each of which represents one band.I also saved the names of the layers in a vector (names_landsat). Now I want to calculate the spectral indices with the following code:

    ind <- landsat_data
    ind <- spectralIndices(ind,blue=as.character(names_landsat[1]),green=as.character(names_landsat[2]),red=as.character(names_landsat[3]),nir=as.character(names_landsat[4]),swir1=as.character(names_landsat[5]),swir2=as.character(names_landsat[6]))

Unfortunately R returns the following error message:

  Error in if ((maxValue(img[[red]])/scaleFactor > 1.5 | minValue(img[[red]])/scaleFactor <  : 
      missing value where TRUE/FALSE needed
    In addition: Warning messages:
    1: In .local(x, ...) : max value not known, use setMinMax
    2: In .local(x, ...) : min value not known, use setMinMax

I have absolutely zero clue what that means as I am pretty new to this package.
I would be very grateful if somebody could give me any kind of help.
Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions