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

JavaScript client library for calling the Google Earth Engine API.

Filter by
Sorted by
Tagged with
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
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
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
12 votes
1 answer
5k views

Understanding tileScale in Earth Engine [closed]

In many Earth Engine functions such as Image.reduceRegions or Image.sample, there is an argument called tileScale. The API documentation generally interprets it as: A scaling factor used to reduce ...
Liman's user avatar
  • 430
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
11 votes
1 answer
13k views

Selecting bands of image collection in Google Earth Engine? [closed]

I want to use the Landsat 8 surface reflection collection (LANDSAT/LC08/C01/T1_SR), which contains the 7 spectral bands plus some extra mask bands. I want to run my algorithm on just the 7 spectral ...
user6072577's user avatar
  • 1,552
11 votes
1 answer
798 views

How to use a custom function inside GEE ee.Reducer?

I have generated a segmentation using SNIC on GEE and calculated some statistics/features for each segment, using ee.Reducer e.g. mean, std, median, etc. I want to calculate more features based on my ...
Federico's user avatar
  • 367
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
9 votes
1 answer
14k views

Exported bands must have compatible data types; found inconsistent types: UInt16 and UInt32

What are the possible reasons for this error? Exported bands must have compatible data types; found inconsistent types: UInt16 and UInt32 This is the code: Map.addLayer(PuntoQuellaveco1); Map....
Alvaro Morales'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
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
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
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
1 answer
7k 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
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
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
1k views

Using scaling factor for collection 2 level 2 with Roy et al constants

I am using the Landsat ETM+ to OLI harmonization tutorial but I need it for Landsat collection 2 L2 data, this means the scaling factors have changed. I am not sure how to apply the scaling factors in ...
salixtreks's user avatar
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
6 votes
1 answer
326 views

Concatenating strings on Google Earth Engine

I'm using the Javascript console on Google Earth Engine, and I'm stumped by a simple problem. I want to concatenate and print two values on one line. One of them is an object property. When I use a ...
John's user avatar
  • 498
6 votes
1 answer
459 views

Getting random points from large FeatureCollection without exceeding user memory limit of Google Earth Engine

How do you select random points from a large FeatureCollection without exceeding the user memory limit? var bigData = ee.FeatureCollection('GLIMS/current'); var randomPoints = ee.FeatureCollection....
cengstro's user avatar
  • 524
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
5 votes
1 answer
994 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
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,047
5 votes
1 answer
738 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
779 views

Why is Earth Engine Export.map.toCloudStorage taking much longer than before?

I've created a script to identify the nth least cloudy mosaic for Sentinel-2 data for a given place and time. A few months ago, I was able to execute an Export.map.toCloudStorage for a visualization ...
Theron Morgan-Brown's user avatar
4 votes
2 answers
2k views

Using Google Earth Engine JavaScript vs. Python API [closed]

Google Earth Engine seems to be most commonly used through either the Python API, or the JavaScript API on the browser. Trying to decide for one, I have come across this comparison, from a Tyler ...
Joris's user avatar
  • 321
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
4 votes
2 answers
2k views

Choosing Google Earth Engine IDE [closed]

I'm starting to play with EE and I jumped right into the online web-based IDE for the Earth Engine JavaScript API (https://developers.google.com/earth-engine/playground). I see there is also a Python ...
KcFnMi's user avatar
  • 563
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
2 answers
4k views

Filter Image Collection by Multiple WRS Path/Rows using Google Earth Engine JavaScript API

How can I filter an image collection in Google Earth Engine by multiple WRS paths/rows? This is an example of a filter using one path.row: var sr2011 = ee.ImageCollection('LANDSAT/LT5_SR') ....
Dex's user avatar
  • 53
4 votes
1 answer
898 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
1 answer
933 views

Listing Unique Pixel Values From Raster in Google Earth Engine

I'm having an issue with what I hope is a rather simple task. I have a raster of worldwide extent and I simply want a list of the unique pixel values in a given band. Example: //load in fire data from ...
eorland's user avatar
  • 73
4 votes
2 answers
2k views

Filtering collection by system:index using Google Earth Engine

I am trying to filter a Sentinel-2 collection by the system:index property. I have selected three specific tiles identified by its respective id, then tried filtering them from a collection using ...
Luis Lizcano's user avatar
4 votes
1 answer
1k views

Aggregate multiple image class values into a single class (Earth Engine)

I have created 20 clusters from unsupervised classification of a specific region in Google Earth Engine. Now I want to reclass them. For example, let's say class values 10, 4, and 16 are forest, I ...
Ashutosh Prasad's user avatar
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
700 views

How can I automatically deselect a mapped layer in Google Earth Engine?

I am currently looking at land cover for two years, e.g. 2001 and 2010. The code I am writing adds the Land Cover layers to the map for both years, so a map of 2001 and one of 2010. I would like my ...
M. Nicolas's user avatar
  • 1,225
4 votes
1 answer
816 views

Google Earth Engine: Apply ee.Reducer to all image values

Background I would like to return percentile values for a multi-band image, using ee.Reducer.percentile(). For example, the image could look like this: var image = ee.ImageCollection('LANDSAT/LT05/...
Joris's user avatar
  • 321
4 votes
1 answer
816 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
1 answer
321 views

Filter and visualize in DataSlider only the dates when images available

I have a code which is calculating NDVI for Sentinel data and creating DateSlider for this image collection for selected study area. Is there a way to filter and visualize in DataSlider only the dates ...
Sarvarbek Eltazarov's user avatar
4 votes
1 answer
353 views

Earth Engine - how to access an image added to Map from inside a function

I have a simple UI that allows the user to select an image from a collection, and loads it to the map. The user then can select a polygon from a list, and a .reduceRegion() using that geometry is to ...
Sean Roulet's user avatar
  • 2,170
4 votes
1 answer
239 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
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
4 votes
3 answers
4k views

Google Earth Engine comment/uncomment shortcut on Mac

This is a bit of a weird question, but I recently switched from a PC to a Macbook (with a latin keyboard) and I cannot figure out the shortcut to comment/uncomment text in the Code Editor. On the PC ...
M. Nicolas's user avatar
  • 1,225
4 votes
1 answer
729 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
1k views

Earth Engine NodeJS API: Failed to load resource and CORS policy issue

I am developing a GEE nodeJS custom application. I have gone through the documentation and source(https://github.com/google/earthengine-api/tree/master/demos/server-auth-nodejs). I setup the service ...
user154666's user avatar
4 votes
1 answer
681 views

Fill gaps in a categorical image with neighbors values in GEE

I'm reclassifying a DEM asset into 6 categories. However, there are some pixels that don't meet my criteria and are null. I would like to find a way to fill these gaps depending on its area and its ...
Luisa Fernanda Velasquez Camac's user avatar
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
250 views

Strange black pixels scattered on terrain flattened image

I am attempting terrain flattening of the Sentinel-1 images here. However, I am encountering strange black pixels scattered throughout, as shown in the attached figure. I was calculating annual median ...
Yuqi's user avatar
  • 33
3 votes
2 answers
286 views

Calculate an equation from two collection image

I've got stuck when I'm trying to calculate MNDISI with MODIS. FYI, to calculate MNDISI, that should use LST collection image and SR collection image, so I'm trying to combine MODIS Surface ...
Kukuh Adi Prakoso's user avatar
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

1
2 3 4 5
24