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

An error occurred while running the perform_PCA function #34

Open
liliy182 opened this issue Dec 12, 2024 · 6 comments
Open

An error occurred while running the perform_PCA function #34

liliy182 opened this issue Dec 12, 2024 · 6 comments

Comments

@liliy182
Copy link

liliy182 commented Dec 12, 2024

When I run the following piece of code with sample data:
PCA_Output <- perform_PCA(Input_Image_File = Input_Image_File,

  •                       Input_Mask_File = Input_Mask_File,
    
  •                       Output_Dir = Output_Dir,
    
  •                       TypePCA = TypePCA,
    
  •                       FilterPCA = FilterPCA,
    
  •                       nbCPU = nbCPU,
    
  •                       MaxRAM = MaxRAM,
    
  •                       Continuum_Removal = Continuum_Removal)
    

I get the following error:
[1] "Extract pixels from the images to perform PCA on a subset"
错误: lexical error: invalid char in json text.
Driver: ENVI/ENVI .hdr Labelled
(right here) ------^
此外: 警告信息:
In CPL_gdalinfo(if (missing(source)) character(0) else source, options, :
GDAL Error 1: Zero positional arguments expected

I've tried to convert the sample data to ENVI format, but it still doesn't work

@liliy182 liliy182 reopened this Dec 14, 2024
@jbferet
Copy link
Owner

jbferet commented Dec 15, 2024

hi @liliy182 ,
the error is cause by the latest version of the package sf (1.0-19), which seems to produce an error when calling gdalUtilities::gdalinfo().

gdalUtilities::gdalinfo works correctly when using sf v 1.0-18

I suggest that you remove sf, and install the previous version using
remotes::install_version('sf', '1.0-18')

@liliy182
Copy link
Author

Thanks for the suggestion, I followed your method to install the sf package, but it is still the same error message, the problem does not seem to be solved,I'm wondering if it has something to do with my r version, my R version is 4.4.2 and Rtools version is 4.4

@jbferet
Copy link
Owner

jbferet commented Dec 15, 2024

hi @liliy182 ,
did you restart R and make sure that sf v1.0-18 was correctly installed?

@liliy182
Copy link
Author

Thanks for the reminder,I've restarted R and made sure I have installed sf v1.0-18 correctly,but it is still the same error message.

@jbferet
Copy link
Owner

jbferet commented Dec 16, 2024

the bug should be fixed in v1.14.5
please update biodivMapR and let me know if the error persists

@liliy182
Copy link
Author

hi jbferet
Thank you very much for your contribution, I have updated biodivMapR and the above issue has been resolved, thanks again.

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

2 participants