Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Why the variable can't work in the loop of GEE?

When I want to use "for" in GEE,I found out that the loop cannot be performed.The code is below:

var list=ee.List([1,2]);
var len = ee.Number(list.length());
for (var i =0;i<len;i++)
{
  var f = select(i);
  print(f);
}

I think the problem is the data format of "len". And I find a solution which I don't understand.The code is below:

list.evaluate(function(li){
for (var i=1; i<=li.length ; i++)
{
  var f = select(i);
  print(f);
}});

The API evaluation has been used in this condition, and the problem has been solved.
But I don't know why. And why I can't get the result with the first code.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!