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

Python client library for calling the Google Earth Engine API.

Filter by
Sorted by
Tagged with
1 vote
1 answer
44 views

Understand what ee.data.getTaskStatus returns

This is maybe very simple question but I could not find the documentation for this function : "ee.data.getTaskStatus" . I could only get the "ee.data.getTaskStatus" documentation ...
ReutKeller's user avatar
  • 1,967
0 votes
0 answers
21 views

Dropdown does not update map on Google Earth Engine (Geemap Python package)

I have estimated NDVI and NDWI for a specific area based on Sentinel 2 images via gee library on Python (Google Earth Engine). More specifically, I have created two functions (one for each index) and ...
Ilias Machairas's user avatar
0 votes
0 answers
18 views

EEException: Image.clip: The geometry for image clipping must not be empty

I'm trying to make a supervised classification with Random Forest using FAO/GAUL administrative boundaries as a Region Of Interest (ROI) to clip the images by ROI bounds on Google Colab. # Get a ...
sandrosena's user avatar
0 votes
0 answers
31 views

How to download a joined image as a CSV file on my local computer?

I used a Landsat tile to extract information (images) from different satellites. Then, I add each image to a band like below. So, How can I download it (img_joined) as a CSV file to my local computer? ...
Raymond's user avatar
1 vote
2 answers
29 views

Compute the Cartesian product of 2 ee.Lists

I want to build the Cartesian product of 2 List in the earthengine Python API. The objective is thus to obtain a single list with all the combinations. I coded something that runs in the JavaScript ...
Pierrick Rambaud's user avatar
1 vote
1 answer
44 views

Why the result of download for Sentinel-2 Cloud Removal doesn't show reflectance value?

I succeed to remove cloud from these step in : https://developers.google.com/earth-engine/tutorials/community/sentinel-2-s2cloudless Then I download the result. But, the result is not in decimal as ...
mega saputra's user avatar
0 votes
0 answers
50 views

Estimating forest cover density through Google Earth Engine

I am trying to make a forest cover map (estimating forest canopy density) of a particular district and block. But I don't know where to start since I am a beginner. I have researched and came to a ...
Spandan Kumar's user avatar
0 votes
0 answers
14 views

Put several different image collections into a new image collection at different bands and download the new image

I have several different image collections and they align with each other well. How can I put them into one image at different bands as a new image collection? In this case, I want to download the new ...
Raymond's user avatar
1 vote
2 answers
23 views

Argmax on 2D GEE Array with more than 2 elements

How do you take argmax on a 2D ee.Array with more than 2 elements? The result with just 2 elements works as expected (in Python API), as suggested by the documentation: ee.Array([[3, 4, 2], [6, 5, 7]])...
ktf's user avatar
  • 33
0 votes
1 answer
20 views

dtype used by Google Earth Engine in NPY export

I'm trying to export a small amount of data from Google Earth Engine using the NPY format. According to the documentation I should get a NumPy binary format but what is the type of the bands ? Here is ...
Pierrick Rambaud's user avatar
2 votes
1 answer
36 views

How does Google Earth Engine decide that coordinates are infinity?

I try to generate a feauture collection of 1 single rectangle coverring the whole world. The why is here unrelevant. In my test suit I want to check that this rectange exista and that its coordinates ...
Pierrick Rambaud's user avatar
0 votes
1 answer
30 views

Upload large shapefiles stored locally to GEE assets through CLI

Trying to a upload large shapefile (400k point geometries covering the whole world) as an asset to Google Earth Engine using the CLI instead of the online Code Editor > Assets > New. The ...
TmtStss's user avatar
  • 23
0 votes
1 answer
22 views

Exporting unique values of classified image as CSV

I am trying to export a CSV that contains all of the classified integer values of of an image in Google Earth Engine using the Python API. I have this working in JavaScript, but I'm a little lost ...
Stephen's user avatar
  • 385
0 votes
1 answer
36 views

File not found, no such file or directory in GEE python

I follow step by step in : https://geemap.org/notebooks/33_accuracy_assessment/#split-training-and-testing When the step to download confusion matrix, there is error. I type the code : import csv ...
mega saputra's user avatar
0 votes
1 answer
27 views

Checking if two FeatureCollections are equivalent

I'm writing a method to get the GAUL geometries simply by names and content_level in Python (pygaul). In my test suit, I want to make sure that one of my method is not case-sensitive and thus generate ...
Pierrick Rambaud's user avatar
1 vote
1 answer
20 views

How to convert HSL to RGB in Earth Engine (Python)?

I have 3 Images representing HSL (Hue, Saturation, Lightness) attributes of a single image. I would like to display them as a single RGB image, meaning I would like to create 3 separate bands with R, ...
SteveAKopias's user avatar
1 vote
2 answers
87 views

geemap.zonal_statistics yields error "ImageCollection.toBands: Too many bands (more than 5000)."

I am trying to extract environmental data from Google Earth and using geemap.zonal_statistics to convert into CSV file: #Add ECMWF/ERA5_LAND/DAILY_RAW dataset images = ee.ImageCollection("ECMWF/...
Yuhuai Seah's user avatar
1 vote
0 answers
17 views

Field not setting properly in GEE Python API

I'm currently using the GEE Python API to calculate multiple fields (an example is soil moisture) for multiple features representing forest fires. While uploading the dataset, I first filter it to the ...
rxc_3049's user avatar
0 votes
0 answers
22 views

Difference in image meta data when using GEE compared to rasterio

I'm accessing SRTM image using GEE, and then I save it as raster and open again with rasterio. I have realized that when I try to get the metadata with GEE, the values are different (and seem to be ...
ReutKeller's user avatar
  • 1,967
1 vote
1 answer
15 views

ImageCollection (Error) Parameter 'index' is required

I am trying to calculate a index of monthly EVI from modis dataset, but am receiving a "Parameter 'index' is required" error. I have found another answer about the question, but it doesn't ...
qingsong's user avatar
0 votes
0 answers
31 views

Wrong scale when exporting Google Earth Engine image as NumPy array

Relatively new to EE. I am trying to export a Google Earth image to a numpy array to run further processing. I have managed to convert the image to an array and have plotted it, but my plotted figure ...
Neo96's user avatar
  • 1
0 votes
0 answers
13 views

How to use machine learning in earth engine applications?

I have developed a earth engine web application for my phd research. However, I can't figure out how to add the results of the machine learning techniques in the app directly without using any paid ...
Mahreen Ahmed's user avatar
1 vote
1 answer
93 views

GEE error while running reduceRegion: GEE Error: Provide 'geometry' parameter when aggregating over an unbounded image

I'm trying to calculate the mean soil moisture value for a particular polygon over a period of time by using ee.Reducer.mean() in ee.reduceRegion() The polygon is initially loaded as a feature; ...
rxc_3049's user avatar
0 votes
0 answers
40 views

Conversion Tool for GEE Javascript to Python Not Working. Getting Assertion Error

I am very new to the Earth Engine Python API and I am trying to convert a significant amount of GEE code to Python in order to have it better integrate with my larger project. I have been attempting ...
Matt's user avatar
  • 93
0 votes
0 answers
62 views

Checking if an asset exists

I want to check if an asset already exists before creating a new one. I'm currently using the following code: def asset_exists(asset_id: str) -> bool: """Check the existence of ...
Pierrick Rambaud's user avatar
2 votes
1 answer
135 views

How to run a Google Earth Engine script locally

I am new to Google Earth Engine. I have been using the Google Earth Engine code editor to create and run my scripts. However, this approach doesn't scale. I have a script that gets the precipitation ...
Ramaraja's user avatar
  • 135
1 vote
0 answers
62 views

GEE Export.image.toCloudStorage option 'skipEmptyTiles' in Python API

I am attempting to save an image from GEE to Google Cloud Storage within the Python API using ee.batch.Export.image.toCloudStorage. The documentation suggests that skipEmptyTiles can be set to true to ...
ktf's user avatar
  • 33
0 votes
0 answers
71 views

All the pixels in an image exported from Earth Engine have the same value

I'm trying to export an image with 42 bands from Google Earth Engine: Some bands correspond to an index like NDBI for Sentinel 2 images and his equivalent for Sentinel 1 images, other band correspond ...
Roger Godofredo Rivero Morales's user avatar
0 votes
0 answers
121 views

*Image* prediction with GEE AI Platform and gradient boosted tree model

I am attempting to build a crop classifier with training data from Sentinel-2 imagery over several seasons. I want to use a gradient boosted tree model instead of a neural net. There are many examples ...
ktf's user avatar
  • 33
0 votes
1 answer
58 views

Downloading dynamic world full rasters (not just mode) over a geography

I have been using the following Python script to download "modes" of the dynamic world dataset like this: mosaic = ( ee.ImageCollection('GOOGLE/DYNAMICWORLD/V1') ...
Ezekiel Barnett's user avatar
0 votes
1 answer
59 views

For loop over Feature Collection to return Image Collection in EE python API

I am new to the EE python API and am struggling to get a for loop (could eventually also use a map function) over a feature collection. My idea is to have one image and a FeatureCollection as input, ...
Felipe Coelho's user avatar
0 votes
2 answers
47 views

Reproject and Export: Data is not reprojected in Google Earth Engine

Google Earth Engine Exporting via Python API a Sentinel 2 harmonized mosaic to the Swiss projection EPSG:2056 results in non correctly reprojected data. Complete code https://code.earthengine.google....
scriptDaddy's user avatar
1 vote
1 answer
47 views

Calculating null percentage of given image in Google Earth Engine

I have been working on cloud masking of the sentinel-2 data and need to calculate the null percentage of the given image for documentation purposes. I have been working using Python API. My code till ...
Raj Bajaj's user avatar
0 votes
0 answers
42 views

GEE Python API method 'prepare_for_export' not available

I want to prepocess a batch of Sentinel-2 images using the code provided by ndminhhus. Earth Engine authentication, Py6S, custom module "atmospheric", basically all necessary modules have ...
Barbara Perez de Araújo's user avatar
1 vote
1 answer
48 views

Image Composition using average values and if-else

I am new to Google Earth Engine and have been using it for just over two weeks now. I have a question about image composition. I have got three images with me that cover the same area over three ...
Raj Bajaj's user avatar
0 votes
1 answer
47 views

Do an average mosaic on an image in Google Earth Engine

So I have been working on a project requiring me to work with Sentinel-2 data on cloud and shadow masking. I have used the following code for masking clouds and cloud shadows using Google Earth Engine....
Raj Bajaj's user avatar
0 votes
1 answer
68 views

How to export defined polygon and FeatureCollection points from Google Earth Engine JavaScript code editor to Python API in Jupyter Notebook

]I am new to GEE. I have written RandomForest code in JavaScript code Editor but our Supervisor is asking me to convert that code to Python API. I am trying to do it in Jupyter Notebook and I want to ...
Hamza Ali Khan's user avatar
0 votes
0 answers
77 views

Using OEEL library in Google Earth Engine Python API

I'm trying to translate a Google Earth Engine project from JavaScript to the Python API. My project involves the Savitzky-Golay filter. I used this method from the OEEL library using the following: ...
sermomon's user avatar
  • 1,084
0 votes
0 answers
64 views

Google Earth Engine ReduceResolution scale

I am trying to optimize my code to run more efficiently on Google Earth Engine (Python API) and want to make sure that I am understanding and using the 'scale' parameter correctly. I am using the ...
Katie Loo's user avatar
-2 votes
1 answer
98 views

Null Percentage Calculation in Google Earth Engine Image

I am trying to find the percentage of null values in an image in Google Earth Engine for Sentinel-2 data after cloud masking, i.e., the percentage of an image that has been reduced due to cloud ...
Raj Bajaj's user avatar
0 votes
1 answer
61 views

Error using ee.Filter.maxDifference in GEE Python API

I'm trying to perform a linear interpolation to fill gaps in Sentinel-2 time series. At some point I need to create a filter using ee.Filter.maxDifference as explained here: var days = 45; var millis =...
sermomon's user avatar
  • 1,084
0 votes
1 answer
45 views

Function to compute zonal statistics in GEE Python API

I am trying to create a zonal_statistics function in Google Earth Engine Python API. The function should be applied to an object of type ee.Image and should receive two arguments: an ee....
sermomon's user avatar
  • 1,084
1 vote
1 answer
86 views

Calculating cumulative sum chart using Google Earth Engine Python API

I would like to calculate cumulative sum chart for time series of 4 images time series sentinel-1. The formular for this is : S0=0, S1=S0 + (x1-x), S2=S1+(x2-x), S3=S2+(x3-x), S4= S3+(x4-x) where xi= ...
user30985's user avatar
  • 349
0 votes
1 answer
33 views

Merging ee.FeatureCollection for training data in PythonAPI

js_shpz = json.loads(geom.to_json()) shpz = ee.Geometry(ee.FeatureCollection(js_shpz).geometry()) fc = geojson.FeatureCollection(mrg) img_clip = image.clip(shpz) training_data = img_clip....
yajnab's user avatar
  • 1
1 vote
1 answer
93 views

Add drawing tools to ui.Panel in Google Earth Engine

I want to add Map.Drawing tools to a ui.Panel. But since its a Map element, only a ui.Element can be add to a Panel. This is my script link https://code.earthengine.google.com/...
MS09's user avatar
  • 125
1 vote
1 answer
24 views

Displayed map from QGIS GEE Plugin not encompassing all of my roi

I want the least cloudy Sen-2 image from a certain period of time to be the background map for my QGIS project. I have also clipped the image to a rectangle that represents my roi, ca. 50km long ...
Barbara Perez de Araújo's user avatar
0 votes
1 answer
118 views

ee.Image.sample not working with Google Earth Engine Python API

I am using ee and geemap in a conda environment running Python 3.9.16 and am trying to sample a raster, i.e. convert image pixels to features. This is a documentation example translated into Python. ...
dazu's user avatar
  • 13
0 votes
1 answer
81 views

GEE ee.Image.sample javascript to python

I want to convert the following javascript to python: var f = final.sample({region: county_j, scale: scale, projection: 'EPSG:4326', numPixels: numPixels}); The problem is how to ...
wxystudio's user avatar
  • 117
2 votes
1 answer
535 views

Import shapefile in GEE Python API

I know how to use GEE with JavaScript to import the shapefile, which is just uploading file to asset, then import it in JavaScript code, just like this: var counties: Table user/wxystudio/...
wxystudio's user avatar
  • 117
0 votes
0 answers
84 views

Calculating RMSE of random forest classification in Earth Engine via Python API

I tried to transform the following JS code to Python to get the RMSE values of my classification. My ported code is the following sampleTraining = predictedTraining.select(['kat_sajat', 'predicted']) ...
Daniel_P_GEO's user avatar

1
2 3 4 5
7