TransWikia.com

Error with filterMetadata of FeatureCollection in Google Earth Engine Python API

Geographic Information Systems Asked by Ahmad Raji on February 13, 2021

I tried to filter a FeatureCollection based on a property i.e. where "Condition" == "Suitable", and count the number of features returned. This is the code I tried.

suitable_Features = irrigation_Cond.filterMetadata('Condition',"equals",'Suitable')
    suitable_Features.size().getInfo()

I got this error

HttpError                                 Traceback (most recent call last)
~Anaconda3libsite-packageseedata.py in _execute_cloud_call(call, num_retries)
    333   try:
--> 334     return call.execute(num_retries=num_retries)
    335   except googleapiclient.errors.HttpError as e:

~Anaconda3libsite-packagesgoogleapiclient_helpers.py in positional_wrapper(*args, **kwargs)
    133                     logger.warning(message)
--> 134             return wrapped(*args, **kwargs)
    135 

~Anaconda3libsite-packagesgoogleapiclienthttp.py in execute(self, http, num_retries)
    914         if resp.status >= 300:
--> 915             raise HttpError(resp, content, uri=self.uri)
    916         return self.postproc(resp, content)

HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/value:compute?prettyPrint=false&alt=json returned "Collection.reduceColumns: Error in map(ID=000000000000000006b6):
Number.gte: Parameter 'left' is required.">

During handling of the above exception, another exception occurred:

EEException                               Traceback (most recent call last)
<ipython-input-80-2f4a623ea954> in <module>()
----> 1 suitable_Features.size().getInfo()

~Anaconda3libsite-packageseecomputedobject.py in getInfo(self)
     93       The object can evaluate to anything.
     94     """
---> 95     return data.computeValue(self)
     96 
     97   def encode(self, encoder):

~Anaconda3libsite-packageseedata.py in computeValue(obj)
    676           body={'expression': serializer.encode(obj, for_cloud_api=True)},
    677           project=_get_projects_path(),
--> 678           prettyPrint=False))['result']
    679 
    680 

~Anaconda3libsite-packageseedata.py in _execute_cloud_call(call, num_retries)
    334     return call.execute(num_retries=num_retries)
    335   except googleapiclient.errors.HttpError as e:
--> 336     raise _translate_cloud_exception(e)
    337 
    338 

EEException: Collection.reduceColumns: Error in map(ID=000000000000000006b6):
Number.gte: Parameter 'left' is required.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP