2

Is it possible to convert a list of numbers to a list of string in Google Earth Engine? I'd like to take something that looks like this

var lis = ee.List([27141, 20043]);

and convert it to something that looks like this

var lis = ee.List(['27141', '20043']);

I imagine this is really simple but I can't find a solution in GEE documentation.

1 Answer 1

6

Any time you want to compute something from each element of a list you can map over it:

print(lis.map(function (number) { return ee.String(number); }));

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.