Skip to main content

Questions tagged [google-earth-engine-python-api]

Python client library for calling the Google Earth Engine API.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

How to detect that GEE batch computation is full?

My colleagues and I we are concurrently launching many batch processes into the Google Earth Engine Python API. They nicely piled up in the queue until one day: How can we in an export script catch ...
Pierrick Rambaud's user avatar
0 votes
1 answer
22 views

What causes geemap.extract_values_to_points() to produce such inconsistent results?

I'm trying to get the average pixel values over a period of time. I used two methods: (a) using .mean() to reduce ImageCollection first and then extract pixel values from the reduced image. (b) ...
LChen's user avatar
  • 13
0 votes
0 answers
27 views

Saving pretrained random forest model for probability predictions in Google Earth Engine

I'm trying to export a pre-trained random forest model as an asset in Google Earth Engine, and then load it back in to predict on new data. The model is trained for binary classification, and I'd like ...
Nissim Lebovits's user avatar
0 votes
1 answer
43 views

Sample raster (Landsat) using points (preferably using Python or maybe GEE Code editor)

I have a point shapefiles that covers an area of Multiple states and multiple Landsat (NDVI) tiles from a span of May-Sept for 2005, 2010, 2015, 2016, and 2021. Let's just focus on 2005 for now. I ...
Ekkehardt Rosasee's user avatar
0 votes
1 answer
42 views

All NDVI Samples over period

I'm trying to extract a dictionary of every single NDVI sample in a given area for a given year. import ee import numpy as np ee.Initialize() point = [29.548087060269182, 34.88359141968356] area = ...
eThernet's user avatar
0 votes
1 answer
59 views

Download all Landsat tiles for a specific data range onto my computer using Google Earth Engine

I want to download all the available Landsat tiles (all bands included) for a given ROI using GEE. By tiles I mean the original tiles USGS uses to organize the Landsat data. I want each individual ...
Ekkehardt Rosasee's user avatar
0 votes
1 answer
15 views

How to change the description of a GEE asset from the API?

I created an ImageCollection. It updated by a pipeline on regular basis so everything related to the asset lives in the pipeline repo including the description in a README.md. I want it to become the ...
Pierrick Rambaud's user avatar
-1 votes
1 answer
56 views

EEException: User memory limit exceeded using GEE with specific dataset

I'm working with the Google Earth Engine API and the dataset SPL4SMGP.007 SMAP L4 Global 3-hourly 9-km Surface and Root Zone Soil Moisture. I'm trying to get the minimum and maximum value for the band ...
Maine's user avatar
  • 1
1 vote
1 answer
42 views

ee.Geometry.toGeoJSONString() generate invalid GeoJSON

I tried to convert Google Earth Engine (ee)'s geometry to GeoJSON with following code. import ee aoi = ee.Geometry.Rectangle([117, 12, 118, 14]) aoi.toGeoJSONString() The toGeoJSONString() returns ...
AMA's user avatar
  • 454
0 votes
1 answer
27 views

USGS slope less than 30° excluding water bodies (Earth Engine)

My goal is to get the land with less than 30deg of slope and exclude water bodies. The USGS/3DEP/10m dataset in Earth Engine produces a slope of 0 for water bodies (e.g. lakes, or ponds). I'm curious ...
bernatfortet's user avatar
2 votes
2 answers
46 views

Checking if object is still cached in Google Earth Engine

I'm using the Python API of GEE and I'm building a mechanism to avoid re-exporting the data to GCS twice when the Python kernel dies in the middle of the transfer process (as a reminder: local -> ...
Pierrick Rambaud's user avatar
0 votes
0 answers
40 views

Earth Engine client library not initialized when using a dask cluster and xarray?

I'm trying to test running a simple math operation client-side using xee, an xarray extension for the Google Earth Engine API. When I set up the Dask client and run the compute() method I keep getting ...
Adriano Matos's user avatar
0 votes
0 answers
30 views

HTTPError: HTTP Error 403: Forbidden after entering ee.Authenticate() token code

This is my first time using geemap and ee libraries. I have followed every step and wrote the code below: import geemap import ee ee.Authenticate() After getting the token code from the pop-up ...
Sam Q's user avatar
  • 1
0 votes
1 answer
37 views

Why are two layers merged in GEE and how to seperate them?

I have flooded and permanent water layer selection through the following code: jrcSurfaceWater = ee.ImageCollection('JRC/GSW1_3/YearlyHistory') \ .filter(ee.Filter.calendarRange(...
M Waqar Anwar's user avatar
0 votes
0 answers
57 views

TypeError: Image data of dtype object cannot be converted to float

The main functionality of the script is to extract GeoJSON data, load it into Earth Engine, retrieve Sentinel-2 imagery, calculate the mean NDVI, and visualize the NDVI for each GeoJSON feature. My ...
Muhammad Waqas's user avatar
0 votes
1 answer
46 views

Using ee.Image.stratifiedSample with .smileRandomForest produces type error (python)

Can you advise me on how to correctly use .stratifiedSample to prep input for .smileRandomForest, using Google Earth Engine (GEE) Python API? I'm trying to create training data with .stratifiedSample. ...
user2748630's user avatar
0 votes
0 answers
27 views

Format error training algorithm for image supervised classification - Google Earth Engine python API in QGIS

I am using Google Earth Engine python API in QGIS to try and run a supervised classification of an aerial image. I started working on a GEE guide on supervised classification, but there seems to be a ...
Tom John's user avatar
0 votes
1 answer
69 views

Getting GEE data faster

I need country-month level nighttime lights data. I have already printed the data using the minimum example on the https://code.earthengine.google.com/ platform, but the current problem is that it ...
Jane's user avatar
  • 1
0 votes
1 answer
66 views

Using large datasets for training in Google Earth Engine

I created a training dataset using polygons outside of GEE and I want to use them now in GEE for a supervised classification in Sentinel-2 images. However when I try to create training points from it ...
rrwork___'s user avatar
0 votes
0 answers
26 views

How can I control the plugins loading order in QGIS?

I created a QGIS plugin that use Google Earth Engine (GEE) python library. The simplest way to use GEE python library in QGIS is by using the GEE plugin. To be loaded properly, my plugin needs that ...
JimPou's user avatar
  • 1
0 votes
0 answers
111 views

Could not convert the GeoJSON to ee.Geometry()

My GeoJSON file's structure: { "type": "FeatureCollection", "name": "10", "crs": { "type": "name", "properties&...
Muhammad Waqas's user avatar
0 votes
1 answer
30 views

Dictionary.get: Dictionary does not contain key: bucketMeans error when mapping Otsu thresholding with edge detection

I'm using Google Earth Engine Python API in Colab to carry out surface water delineation with Sentinel-1 data. The analysis uses Otsu thresholding with edge detection as described here: https://google-...
Nathan V's user avatar
0 votes
1 answer
34 views

Discrepancy when counting pixels in Google Earth Engine Python API

I have this polygon: ee.Geometry({ "functionInvocationValue": { "functionName": "GeometryConstructors.Polygon", "arguments": { "coordinates&...
user88484's user avatar
  • 1,829
0 votes
0 answers
25 views

EEException: Unable to use a collection in an algorithm that requires a feature or image

EEException: Unable to use a collection in an algorithm that requires a feature or image. This may happen when trying to use a collection of collections where a collection of features is expected; use ...
user240326's user avatar
0 votes
1 answer
34 views

How to extract a grid layer from GEE image?

Recently while working with GEE in python I was trying to slice a Landsat image to get its bands and grid for a specific area. On the first stage I sampled a neighborhood around a point with radius ...
Aleksey Rozanov's user avatar
0 votes
1 answer
56 views

Implementing and() method for ee.Image in Google Earth Engine Python API

I am struggling to implement Google Earth Engine's and method in the Python API. I have two binary images (one called gfm and one called hf) and would like to find the union of them. In the GEE ...
Micky Maganini's user avatar
0 votes
1 answer
68 views

how to efficiently retreive the latest image in an imagecollection in GEE?

I'm building a function that take 2 parameters, an crop mask image collection (I need to be agnostic) and a crop year int. With this what i want to do is either the filtered image collection contains ...
Pierrick Rambaud's user avatar
0 votes
1 answer
23 views

GEE API error computed value is too large when running Random forest classification

I run randomforest classification in gee API. My script below: label = 'class' bands = ['VV', 'VH'] # Load training data from FeatureCollections training_14Aug_shp = ee.FeatureCollection('projects/...
user30985's user avatar
  • 357
1 vote
0 answers
81 views

geetools batch export suddenly not working

I am trying to use the geetools library to export all the Sentinel-2 images available for the period 2020-2024 for a specific area to which I have clipped them, but I get the error "--------------...
diego bárb's user avatar
0 votes
1 answer
86 views

How to get the date of the most recent image in a EarthEngine collection

I have a daily pipeline running to retreive data on GEE. it is only triggered when new data have been updated on GEE. I have the current list of image collection: list_collection = [ "...
Pierrick Rambaud's user avatar
0 votes
0 answers
182 views

Importing GeoJSON file to feature collection into Google Earth Engine using Google Colab

I am new to code and using Earth Engine Python API. I converted a shapefile to a GeoJSON. I need to convert my geojson file to a feature collection and upload it into my Google Earth Engine repository....
Thandeka Skosana's user avatar
0 votes
1 answer
33 views

Resolution is changing in Google Earth Engine output

GEE is changing the spatial resolution when I sum a feature collection and I am not sure what I am doing wrong. Here is some example code. data = ee.ImageCollection("ECMWF/ERA5_LAND/DAILY_AGGR&...
user44796's user avatar
  • 1,925
0 votes
1 answer
22 views

Converting list to feature collection in Google Earth Engine (python api) failing

I am trying to convert a list of images in GEE to an image collection, then get the mean and export the results. However, the code I have doesn't seem to work. The error when exporting the image is ...
user44796's user avatar
  • 1,925
0 votes
0 answers
19 views

When can I delete files from GCS when downloading to GEE?

I am downloading data from GCS to GEE using the following code: # define the GEE parameters for exportation gcs_shp = next(f for f in shp_files if f.suffix == ".shp") gcs_shp = f"gs://{...
Pierrick Rambaud's user avatar
0 votes
0 answers
30 views

Extracting monthly band data from an image collection from a pixel with 1000 sample points into a table as CSV - not as chart

I have 1000 field samples as points. I would like to Extract band values from ERA5land which is already monthly aggregated for each of the points The data is stored in many bands, I have selected my ...
David Appiah-Gyimah's user avatar
0 votes
1 answer
103 views

How to upload a file from Google Cloud Storage bucket to Google Earth Engine asset using Python? [closed]

I would like to upload a shapefile from a gcs bucket to GEE assets using the Python API. My understanding of the documentation and the source code of the UploadTableCommand is that I should do: import ...
Pierrick Rambaud's user avatar
0 votes
1 answer
46 views

Retrieve server side object values using getInfo()

I'm having trouble converting a server-side object which contains a number into a client-side value effectively. I'm using GEE python API. getInfo() function takes a lot of time to process. # Get the ...
Himal Sudasingha's user avatar
0 votes
0 answers
78 views

Applying a Savitzky-Golay filter using OEEL with Google API

I've been writing a code based on instructions from Geo for Good 2022: Time Series Processing Using Google Earth Engine- https://www.youtube.com/watch?v=ncb5_zbvnaU. Specifically, after creating a ...
Mike Baars's user avatar
1 vote
0 answers
25 views

Efficient method to extract Sentinel-2 band average per date per polygon using Google Earth Engine Python API

I have a folder with over 100 polygons, each polygon is relatively small (~5 ha). I would like to get the average per band, per date, per polygon. The final expected result should be a table. i.e., pd....
user88484's user avatar
  • 1,829
0 votes
1 answer
66 views

Reducing an ImageCollection in Google Earth Engine Python API generates empty image

I am trying to calculate the minimum cumulative water deficit for a region. terraclim = (ee.ImageCollection('IDAHO_EPSCOR/TERRACLIMATE') .filterBounds(roi) .filterDate('...
Ana Catarina Vitorino's user avatar
0 votes
0 answers
137 views

Mapping function with multiple arguments in Google Earth Engine

It is common to use nested functions in Google Earth Engine to create a function that receives several arguments and can be mapped through an ee.ImageCollection. Until now I had always done it the ...
sermomon's user avatar
  • 994
0 votes
1 answer
53 views

Displaying remote sensing imagery on GEE using Folium maps

I am a novice GEE user, and am just getting started with analyzing satellite data using the Python API on Google Colab. I have successfully imported MODIS data and am displaying it using Folium, but ...
Noah Jacobs's user avatar
0 votes
0 answers
154 views

Resample Sentinel-2 bands from 20m to 10m using GEE code outside of GEE

I want to resample the 20 meters bands of Sentinel-2 to 10 meters. I found this piece of code in GEE and after trying it out, this is what I would like to do to my Sentinel images but outside of GEE. ...
rrwork___'s user avatar
0 votes
1 answer
50 views

Problem to convert to a FeatureCollection

I want in Python make a script that: Import the local shape file "D:/Municipios.shp", With Google Earth Engine API import the band 'Tair_f_inst' of the collection 'NASA/GLDAS/V021/NOAH/G025/...
Juan David Gutiérrez's user avatar
-1 votes
1 answer
125 views

Filtering image collection based on a custom function Google Earth Engine Python API

I want to filter image collection based on a custom function Google Earth Engine (GEE) Python API. For example, and this is just an example to make this question tangible. I want to filter the ...
user88484's user avatar
  • 1,829
0 votes
1 answer
196 views

Batch task execution in Google Earth Engine Python API

In Google Earth Engine Compute Units (EECUs) There are two kinds of EECUs: “Batch” and “Online.” Batch EECUs are typically used for very large jobs (for example, exports), and online EECUs provide ...
user88484's user avatar
  • 1,829
0 votes
1 answer
188 views

Get MEAN SOLAR AZIMUTH ANGLE from Sentinel-2 L2A product

I was coding in Google Earth Engine and one of the functions I run for cloud and shadow masking used the MEAN_SOLAR_AZIMUTH_ANGLE property. shadow_azimuth = ee.Number(90).subtract(ee.Number(img.get('...
rrwork___'s user avatar
0 votes
0 answers
27 views

Collection of images for specific points without exceeding memory in GEE

I've been using your help for months now but today it's my time to ask my first question. I have been working with a collection of images for 4 years for small areas and developed a script that ...
Giannis Gallios's user avatar
0 votes
0 answers
40 views

Display url thumbnail generated by GEE in python

I am trying to generate a thumbnail image from GEE using python, but when I try to do so, it only returns the object and not the image. I am following the code here. Here is the relevant code. import ...
user44796's user avatar
  • 1,925
2 votes
1 answer
79 views

Getting bounds of projection in Google Earth Engine Python API [closed]

I'm building a small function to create a grid based on a size and a projection. This grid will be worldwide or more specifically covering the whole projection area of use. Is there a way to get the ...
Pierrick Rambaud's user avatar

1
2 3 4 5
8