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

JavaScript client library for calling the Google Earth Engine API.

Filter by
Sorted by
Tagged with
11 votes
2 answers
35k views

Exporting each image from collection in Google Earth Engine

I am trying to export each image in a filtered stack of Sentinel-1 images and cannot seem to get it right. Think link suggests using imageCollection.map() and a custom function (such as a geometric ...
ThrushJacket's user avatar
24 votes
2 answers
9k views

Mosaicking Image Collection by Date (day) in Google Earth Engine

I have an image collection of Sentinel-1 data over 3 years filtered by a region of interest that spans 3-4 tiles, and want to know the best way to mosaic all the images (tiles) that were taken on the ...
deepsky's user avatar
  • 469
7 votes
3 answers
13k views

Filtering Landsat images base on cloud cover over region of interest

My goal is to create an image collection that has 100% free cloud over a small region of interest, for example a lake. This script filters landsat 8 images based on location and cloud cover: var ...
Minh Shines's user avatar
13 votes
1 answer
19k views

Extracting pixel values by points and converting to table in Google Earth Engine?

I realise that this question has been asked before as Extract pixel values by points and convert to a table in Google Earth Engine at Stack Overflow. However, I can't get the code to work. It runs, ...
Thomas Worthington's user avatar
7 votes
2 answers
14k views

Cloud mask for Landsat8 on Google Earth Engine

I'm creating a composite image, in order to create a timeseries. I've already created the composited image, but i am having difficulty masking the clouds of the composite image. I've followed the code ...
Isaaqm's user avatar
  • 113
3 votes
1 answer
4k views

Customizing a continuous legend in Google Earth Engine

I've created legends in ggplot, which look like this With the code I've used in Google Earth Engine, this is what my legend looks like Is there an easy way for me to edit my Google Earth Engine code ...
r1c3bowl22's user avatar
12 votes
2 answers
10k views

What are the min and max values of Map.addLayer on Google Earth Engine? [closed]

I'm starting to play with Google Earth Engine. Following https://developers.google.com/earth-engine/image_visualization I see its possible to set min/max values. May I ask the meaning of this and ...
KcFnMi's user avatar
  • 563
2 votes
3 answers
653 views

Keeping the actual band names in GEE exported images

I am exporting some images from Google Earth Engine. But in the exported image the band names are not there. Means it is showing band_1, band_2, and so on instead of their actual band names. This is ...
Badal's user avatar
  • 309
7 votes
1 answer
6k views

Google Earth Engine: Extract values from FeatureCollection as list

I'm trying to extract values from a FeatureCollection as a list. Here's some example code that I'm using in Earth Engine's code editor: var viirs = ee.Image('NOAA/VIIRS/DNB/MONTHLY_V1/VCMCFG/...
Rob Marty's user avatar
  • 369
5 votes
1 answer
3k views

Calculate mean EVI for multiple polygons across an image collection in Google Earth Engine

My goal is to calculate mean EVI for a collection of polygons for each image in an image collection. My collection of polygons is a GEE feature collection (called 'polys') and I'm using the Landsat ...
Sarah Chisholm's user avatar
4 votes
1 answer
2k views

Creating binary image from FeatureCollection in Google Earth Engine

I am trying to find a solution for this based on ee.FeatureCollection.reduceToImage, but I don't seem to be able to find it. Suppose you have a region of interest such as var ROI = ee.Geometry.Polygon(...
Michael's user avatar
  • 1,176
4 votes
1 answer
815 views

Run LandTrendr algorithm on a collection of points/pixels in Earth Engine

Regarding the LandTrendr algorithm in Earth Engine... I have prepared an input image collection and can successfully get a result from the algorithm (no errors), but how can I extract segmentation ...
Justin Braaten's user avatar
4 votes
2 answers
1k views

getValue() from second order ui.Select in Google Earth Engine

I would like two make two ui.Select widgets. The items of second ui.Select depends on first ui.Select. Then I would like to get values of both ui.Selects using ui.Button. I have drafted a code, but it ...
Sarvarbek Eltazarov's user avatar
3 votes
3 answers
419 views

How to drop ee.Image properties?

I am trying to drop some properties of an image in Google Earth Engine, but I just can't figure it out. Things I've tried: var palsarForest = ee.ImageCollection('JAXA/ALOS/PALSAR/YEARLY/FNF').aside(...
Andrei's user avatar
  • 766
3 votes
1 answer
4k views

Masking pixels in image collection using Google Earth Engine JavaScript API

I want to mask pixels based on the quality band information for image collection Landsat 5. This is my code but the image-collection is empty afterward. Can you help me? var startDate = '1992-01-01' ...
Mahsa Jami's user avatar
1 vote
2 answers
878 views

Getting the value of label of the polygon clicked

I am using Google Earth Engine to display a shapefile. I have also added an inspector to get lat/long. in my shape file i have the attribute table with the name "DIVISION_N", when i click on ...
Asim Gulzar's user avatar
1 vote
1 answer
195 views

Export an image in GEE to open it in ArcGIS Pro

I used following codes to export image from the GEE to open in ArcGIS Pro: var geometry = ee.Geometry.Rectangle([-114.3461, 51.2335, -113.8015, 50.8140]); function maskS2clouds(image) { var qa = ...
Mahsa's user avatar
  • 41
0 votes
1 answer
571 views

Getting Cloudfree image for small area (Sentinel-2) using Google Earth Engine

I am trying to get a cloudfree image from Sentinel-2 for multiple small areas (circles with a radius of 20km) in Ghana, a very cloudy area. Using the standard algorithms (median image, filter for ...
erpunkt's user avatar
  • 21
0 votes
1 answer
65 views

Google Earth Engine : adding two select boxes to a panel

I want to add two select boxes to a panel. When I select from the the first select box, a second select box to be shown. The problem is that when I select from the first box second box loads again and ...
MS09's user avatar
  • 135
0 votes
1 answer
364 views

Error: "l8.filter is not a function"

I'm writing a code to calculate vegetation indexes and plot charts for each index. In the same script I've added the code to make a GUI for the same. I'm getting the error: Error: "l8.filter is ...
Shubh's user avatar
  • 9
10 votes
1 answer
5k views

GEE ImageCollection.map() with multiple-input function

I have an Image Collection, I want to Calculate a Normalized difference and got this Function called ND /////normalized Differense/////// function ND(Im,B1,B2){ var four = Im.select(B1) var eight = Im....
Alexander Vocaet's user avatar
8 votes
2 answers
6k views

Getting latest image from imageCollection using Google Earth Engine JavaScript API

I'm trying to get the last image available in an image collection but I can't find any function that works. I've tried also to sort the collection in the reverse order, but it doesn't work. here is ...
Giox's user avatar
  • 253
7 votes
1 answer
2k views

Results of Variable Importance of RF Classifier in GEE

I create a RF module in GEE like this: //Random Forest Result Function Module exports.getRfResults = function(image, title, bands, trainPoint, testPoint, area, label) { //Create Sample Points ...
BerkayOzen's user avatar
7 votes
1 answer
2k views

Creating DateSlider for whole image collection in Earth Engine

I am need to create DateSlider for whole Sentinel-NDVI collection during given period. Is there any way to do so? https://developers.google.com/earth-engine/ui_widgets, here I found an example, but I ...
Sarvarbek Eltazarov's user avatar
7 votes
1 answer
2k views

Exporting image from app-side using Google Earth Engine

I've built an app that displays an image. I want the user of the app to be able to download the data from the viewport in a GeoTIFF format for further use in GIS. I've got my export function running ...
rockhound's user avatar
7 votes
2 answers
4k views

Filter FeatureCollection with multiple values

Is it possible to use an equality filter for a FeatureCollection in GEE based on multiple values? I understand how to filter by one value: collectionName.filter(ee.Filter.eq('COLUMN','VALUE')); But ...
Stephen Wood's user avatar
5 votes
1 answer
731 views

Conditionally Map.addLayer() in Google Earth Engine

My app has a dateSlider that searches multiple collections, and selects the image nearest to a date within a window. I want to conditionally display those images, with error handling for empty images. ...
cengstro's user avatar
  • 524
5 votes
1 answer
2k views

reduceResolution failes in Google Earth Engine

I have three images in GEE ,I would like to reproject two of them to have the dame reprojection as the third one. each of those 3 images is mosaic of all the avilable tiles from certain day. The ...
ReutKeller's user avatar
  • 2,037
5 votes
1 answer
991 views

Calculating daily max and min temperature data from GLDAS over several years using Google Earth Engine

I am still new to the Google Earth Engine and try to calculate the daily max and min temperature based on the GLDAS. Could you advise me on how I correct this code to calculate daily max and min ...
Zara's user avatar
  • 137
4 votes
1 answer
891 views

Cloud Shadow Removal for Sentinel-2

I am trying to classify my study area with a RandomForest classifier, using Sentinel-2 Surface Reflectance images. This classification gave me an accuracy of about 87%. I calculated the misclassified ...
Learner's user avatar
  • 119
4 votes
2 answers
2k views

Different methods for masking clouds of Sentinel-2 images in GEE

Working with GEE I noticed that there are different methods for masking cloud pixels in Sentinel-2 images. I would like to clear up some doubts about the different methods. Here are two of the ...
sermomon's user avatar
  • 1,104
4 votes
1 answer
237 views

Casting computed list by using 'forEach' reducer method

I adapted the code in Export raster over a loop in Google Earth Engine for adding raster layers by using a dates list instead a country names list. Complete code looks as follows. var aoi = ee....
xunilk's user avatar
  • 29.7k
4 votes
1 answer
723 views

Exporting CSV of time-series for every polygon from table of polygons

My question has a similar intention as in this link: Exporting time series of multiple polygons to .csv. format table However, in my case, following this code, the table output runs for hours and then ...
Akriti's user avatar
  • 141
4 votes
1 answer
2k views

Calculating NDVI per region, month & year with Google Earth Engine

This question refers to post: https://stackoverflow.com/questions/53280885 on stackoverflow. It was recommended by a user to repost here. I have modified the code posted by @Kel Markert https://code....
Jock's user avatar
  • 115
3 votes
2 answers
3k views

Adding text and legend to image collection animation in Earth Engine [closed]

I have a GIF image generated using the ui.Thumbnail() function I wanted to embed the label below, inside the GIF image. The GIF is generated using ui.Thumbnail and the label is generated using the ...
theredcap's user avatar
  • 141
3 votes
1 answer
239 views

Cloud masking for sentinel surface reflectance multi-images.But I cant apply for multi-images using Google Earth Engine JavaScript API

I want to do cloud masking for sentinel surface reflectance images but I cannot apply for multi-images,It was done for first image. How could I do that using the Google Earth Engine JavaScript API? ...
Canan's user avatar
  • 43
3 votes
3 answers
3k views

Google Earth Engine: Understanding Landsat 7 Collection 2 QA_PIXEL, bitwiseAnd() for cloud mask

I want to see how the new Landsat 7 Collection 2 (C2, 'LANDSAT/LE07/C02/T1_L2') differs from Collection 1 (C1). I have created an adequate Landsat 7 C1 composite since GEE provides a cloud mask ...
Matt Payne's user avatar
2 votes
1 answer
3k views

Exporting RGB image from Google Earth Engine

I have a natural color of Hawaii Main Island to export, but when I exported it, it only showed a grayscale information in QGIS, but I know that this is not a QGIS problem, it's from GEE. This was the ...
Santiago Morillo's user avatar
2 votes
1 answer
980 views

Exporting raster over loop in Google Earth Engine JavaScript API

I would like to export raster in a foreach loop with : var landCover = ee.Image('MODIS/006/MCD12Q1/2016_01_01').select('LC_Prop1'); var countries = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017'); ...
delaye's user avatar
  • 729
2 votes
1 answer
1k views

Adding multiple indices as bands to image

I want to be able to classify my image using bands for prediction (B2, B3, B4, etc.) but I also want to use indices as "bands" (B2, B3, B4, NDVI, EBBI, MSAVI2, etc.). Unfortunately, I can't seem to ...
Linus AG's user avatar
2 votes
1 answer
2k views

Downloading image from Google Earth Engine

I would like to download an image from GEE to ArcGIS, with all information (coordinate, pixel value). I am trying but I couldn't. How can I to do that? I got this message: Error: Image....
Fabian Moreno's user avatar
2 votes
1 answer
347 views

Iterating through a date property in a feature collection to get before and after an event images

I have 50 points uploaded into Earth Engine with a date property. Each of the point has a varied date. I would like to iterate through each point selecting the date and use it to get 10day before and ...
Shiraz's user avatar
  • 192
2 votes
0 answers
782 views

Generation of snow cover area time series in GEE using MODIS Snow Cover product

My aim is to resample MOD10A1/MYD10A1 to the same scale as that of MOD11A1/MYD11A1, mask the image collection to obtain the best pixels, and finally to obtain the time series plot of the total area ...
Vineeth's user avatar
  • 47
2 votes
2 answers
352 views

List of land cover classes in particular area and use them as an item for ui.Select

I would like to identify the list of land cover classes in particular area and use them as an item for ui.Select. And I would like to use below given label for identified land cover values. I have ...
Sarvarbek Eltazarov's user avatar
2 votes
1 answer
1k views

Exporting only select feature properties to CSV file from Google Earth Engine JavaScript API

I want to calculate the number of fires for a region and export the result to Google Drive as a CSV file. The code I'm using to do this seems to work, but the object fire_ind_count contains many ...
Leosar's user avatar
  • 309
2 votes
1 answer
902 views

How to open a list of images from an asset as an Image Collection?

I need to create an Image collection from a list of images that I import from an asset in GEE. This is the code I am using: //THE CREATION OF A IMAGECOLLECTION WORKS WITH TWO IMAGES LOADED HERE var ...
thiagoveloso's user avatar
1 vote
1 answer
2k views

Mask Sentinel-2 image using SCL product in Google Earth Engine

I need to create a Google Earth Engine (JavaScript API) function to mask the pixels corresponding to no_data, satured_or_defective, dark_area_pixels, cloud_shadows, unclassified, ...
sermomon's user avatar
  • 1,104
1 vote
1 answer
363 views

Stacking Landsat band in Sentinel collection using Google Earth Engine JavaScript API

I have worked on the following code to obtain a fusion of both sensors but when I generate it I get Landsat as an additional property, what can I do? var s2 = ee.ImageCollection('COPERNICUS/S2') ....
María's user avatar
  • 15
1 vote
1 answer
385 views

Blank Image - Pansharpening Sentinel-2 imagery in Google Earth Engine

Referring to Pansharpening Sentinel-2 imagery in Google Earth Engine and the solution provided In the answer the code mentioned refers to the use of a single image, instead, I am trying to use it on ...
Vikrant Vijay Patil's user avatar
1 vote
1 answer
668 views

How to display a large series of images to the map with a for loop in Earth Engine

I need to view imagery from a collection as separate layers. Since I have to do this for several sites and the number of images in the collection therefore varies, I tried to apply a for loop to solve ...
MMartin's user avatar
  • 25