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

Issue with Script 6 -- Interactive Assemblage #39

Open
mickymags opened this issue Feb 16, 2022 · 1 comment
Open

Issue with Script 6 -- Interactive Assemblage #39

mickymags opened this issue Feb 16, 2022 · 1 comment

Comments

@mickymags
Copy link

Hello,

This is a minor quality of life issue in "Script 6 -- Interactive Assemblage" of the RLCMS code in Google Earth Engine. Again, I am using the code authored by Khanal Nishant, which can be found on page 14 (Chapter 3) of the RLCMS Portal User Guide and Manual, which can be found here (https://gdoc.pub/doc/e/2PACX-1vQWuDUyC3KO0GMrqxvP2uc_LvUgkCAnU-cAIqJx5G0A0h7V7UyNF3gEkXMjorwE059Y06DwpyJCVfcb)

The code runs perfect when including four land cover classes for mapping (screenshot included as "No_Issue.png"), but when attempting to create a land cover map with more or less than four land cover classes, the console returns "Please submit the right number of labels" and the legend no longer appears in the bottom right-hand corner of the map ("screenshot included as ("Issue.png")

Thanks in advance!

No_Issue

Issue

@mickymags
Copy link
Author

This error is due to the fact that this script, when creating the legend, calls on the imageVisParams variable, which is imported as a variable at the beginning of this script. This imported variable contains five colors, four for the defined landcover classes, and one for "other land"

The portion of the script that defines the legend uses the imageVisParams variable in order to create the legend, thus throwing this error if more or less than four landcover classes are used.

I am currently trying to rewrite this code using a for loop such that the user could define any number of landcover classes in their script and get a good-looking map and functional legend.

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

1 participant