When I display my classification map, the colors don't line up with the variable that I want them to. For example, my forest
category is represented as red (instead of my goal color-green), or my water
category shows up as gray (instead of 'blue').
How do I order my color palette such that it corresponds with the classes appropriately?
This is my script so far in Google Earth Engine:
//Create a classification map. Classify the input imagery
var classified = composite.select(bands).classify(classifier);
//Define the palette for the land use classification
var palette = [
'0000FF', // water (0) -- blue
'FFFF00', // cultivated (1) -- yellow
'DCDCDC', // Settlement (2) -- gray
'F0E68C', // Grasslands (3)--khaki
'228B22', // forest (4)-- forest green
'000000', //clouds (5)-- black
'808000', //intact veg (6)-- olive
'FFA500', //impacted_veg (7)-- orange
'DC143C', //mines (8)-- crimson
];
// Display the classification result and the input image.
Map.centerObject(K2C_aoi);
Map.addLayer(classified, {min: 0, max: 2, palette: palette}, 'Land Use Classification');