Google Earth Engine – How to Filter Images with ee.data.listImages() API

google-earth-enginegoogle-earth-engine-javascript-api

According to the docs, ee.data.listImages() takes optional parameters for filtering the assets using image properties. However, I can't seem to get the image filtering to work… I want this code to filter the assets (original size=2) to return just one.

var path = "projects/ee-caseyengstrom/assets/testFolder/"
var assetList = ee.data.listImages(path)
print(assetList['images']) 

var filteredList= ee.data.listImages(path,{
  properties:["num_prop<2", "str_prop=='a'"],
  filter: "properties.num_prop<2"
})
print(filteredList['images']) // not working; should return list of size 1

https://code.earthengine.google.com/84195ab6054c77dabb35f813ac60130f

Best Answer

listImages operates on collections, not folders. Under the covers, it's just calling listAssets.

listAssets works on collections and folders, but doesn't support filtering on folders.

Related Question