Google Earth Engine (GEE): A mapped function's arguments cannot be used; Conversion between ee.element and python types;

        This article addresses this issue: EEException: A mapped function's arguments cannot be used in client-side operations.

        I stepped on this pit for four days.

        I wanted to use GEE to download Sentinel-2 vector slices. The original code is this one from Mr. Wu Qiusheng: 96 image chips - geemap

        But it doesn't have a loop, so when I want to do it for a lot of time or a lot of positions, I have to write a loop to cover it. Well here comes the problem. There are a lot of getInfo in this example, and many pits have been buried.

getInfo——the only function from ee type to python (or JS) type!

        This is only because I have searched for several days, and there is really no other solution. For example, if you want to convert ee.List to list, the problem of converting ee.list to List is essentially a problem of the type of client and server. Server-side things (ee.XXX) can only be converted into client-side (python) through getInfo type) stuff. You can refer to this official document: https://developers.google.com/earth-engine/guides/client_server But getInfo cannot be used in the map.

        So when you encounter getInfo, you will report an error A mapped function's arguments cannot be used in client-side operations.

         The solution is also very simple and rude: replace map with for. Although the advantages of parallel computing are lost, at least it can run!

   

 

Guess you like

Origin blog.csdn.net/weixin_46812066/article/details/128649426