1

I have a large set of points (with longitude and latitude) for which I need to extract the rasters (B1-B8A) in a CSV file. I am currently using geemap.extract_values_to_points.

geemap.extract_values_to_points(
    points,
    composite_S2 ,
    './data/s2points-raster.csv',
    scale = ee.Projection('EPSG:3035').nominalScale())

This works for a smaller section but doing it on a larger set of points yields me the following error:

    HttpError                                 Traceback (most recent call last)
    File c:\Users\[User]\AppData\Local\Programs\Python\Python38\lib\site-packages\ee\data.py:328, in _execute_cloud_call(call, num_retries)
        327 try:
    --> 328   return call.execute(num_retries=num_retries)
        329 except googleapiclient.errors.HttpError as e:
    
    File c:\Users\[User]\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\_helpers.py:130, in positional.<locals>.positional_decorator.<locals>.positional_wrapper(*args, **kwargs)
        129         logger.warning(message)
    --> 130 return wrapped(*args, **kwargs)
    
    File c:\Users\[User]\AppData\Local\Programs\Python\Python38\lib\site-packages\googleapiclient\http.py:938, in HttpRequest.execute(self, http, num_retries)
        937 if resp.status >= 300:
    --> 938     raise HttpError(resp, content, uri=self.uri)
        939 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 "Computation timed out.". Details: "Computation timed out.">
    
    During handling of the above exception, another exception occurred:
    
    EEException                               Traceback (most recent call last)
    location-of-notebook\extract-raster-points.ipynb Cell 9 in <module>
    ----> 1 geemap.extract_values_to_points(points, S2_of_countries_2018 ,'./data/s2points-raster.csv', scale = ee.Projection('EPSG:3035').nominalScale())
    
    File c:\Users\[User]\AppData\Local\Programs\Python\Python38\lib\site-packages\geemap\common.py:7776, in extract_values_to_points(in_fc, image, out_fc, scale, crs, crsTransform, tileScale, stats_type, timeout, proxies, **kwargs)
    ...
        328   return call.execute(num_retries=num_retries)
        329 except googleapiclient.errors.HttpError as e:
    --> 330   raise _translate_cloud_exception(e)
    
    EEException: Computation timed out.

Looks like I'm running out of memory on gee? Because it works fine on smaller areas. Is there a way to overcome this in GEE? or an alternative way via which I could pull out raster point values from composite images of large polygons? Any piece of knowledge shared is highly appreciated.Thanks!

P.S.: This is the API version (on Python) and not the online CLI version on GEE (that uses javascript).

1 Answer 1

1

I'm not familiar with the geemap.extract_values_to_points function, but it looks like it is using Earth Engine's interactive request environment for processing. In this case, requests must complete in 5 minutes. My guess is that it is taking more than five minutes to assemble the FeatureCollection for download as CSV. You have a few of options (among others). Also, if you are doing any processing to the images, consult the best practices guide to ensure that your methods are efficient.

  1. Break up your point collection into a few chunks and make multiple calls to extract_values_to_points in a for loop - concatenate the results later.

  2. Export the CVS to Google Drive or Cloud Storage using ee.Batch.Export functions, which uses the batch processing environment.

  3. Try out the high-volume request endpoint to download point data in parallel - see this blog post for ideas.

2
  • Is there a way to split a FeatureCollection (FC) such that my FC with 8000 points can be split into 4000+4000 that way I can iteratively export and merge. I've been looking for a while but can't understand how to go about it. (developers.google.com/earth-engine/apidocs)
    – SavvY
    Commented Dec 25, 2022 at 3:40
  • I used the first approach and it worked as I broke down to 1000 points per Feature Collection using ee.FeatureCollection(points.toList(size, offset)). Thank you!
    – SavvY
    Commented Dec 25, 2022 at 22:21

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.