0

How does one go about removing properties from an Image object in Google Earth Engine?

I thought maybe I could remove properties one at a time by setting them to null (which apparently you can do for Features, based on Property with null-value disappearing from feature when creating feature-collection in Google Earth Engine?

How do you remove multiple properties from an image?

Example:

var im = ee.Image("LANDSAT/LT4_L1T_TOA/LT40280331982317XXX01");

var imcc = im.get('CLOUD_COVER');
print(imcc); 

var im2 = im.set('CLOUD_COVER', null);
var im2cc = im2.get('CLOUD_COVER');
print(im2cc);
print(im2);

Which sets the property CLOUD_COVER to null, but doesn't actually remove the property itself: enter image description here

I'm only trying to do this as an exercise to learn the structures of objects in Google Earth Engine and how to manipulate them.

3
  • As per the Tour there should be only one question asked per question. When a question is about code a code snippet that illustrates what you have tried and where you are stuck should be presented as formatted text within its body.
    – PolyGeo
    May 2, 2019 at 21:41
  • why do you want to remove the properties? you got to be more specific in telling which is your goal, otherwise we won't be able to help you May 2, 2019 at 23:16
  • Don't remove properties. Just use .select(['LIST_OF_PROPERTIES]) on features or feature Collections to show only the ones you need for further calculations/ export.
    – Kuik
    May 3, 2019 at 7:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.