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

JavaScript client library for calling the Google Earth Engine API.

Filter by
Sorted by
Tagged with
10
votes
1answer
13k 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, ...
5
votes
1answer
44 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. ...
5
votes
1answer
1k 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 ...
5
votes
1answer
232 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 ...
4
votes
2answers
251 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 ...
4
votes
1answer
55 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 ...
4
votes
1answer
668 views

Understanding tileScale in Earth Engine

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 ...
4
votes
1answer
217 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 ...
4
votes
1answer
871 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....
4
votes
1answer
116 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 ...
4
votes
1answer
51 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 ...
3
votes
1answer
2k 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....
3
votes
1answer
91 views

Creating random Image in Google Earth Engine

The final input of my work will be quintile ee.Image objects. To test my display I would like to create an ee.Image with the value in each pixel set randomly in [1, 5] (only integer). I have already ...
3
votes
1answer
76 views

Define several variables at once in GEE

I am looking for a quick way of defining several variables at once in GEE. My code currently is written like this: var a = 0; var b = 0; var c = 0; var d = 0; which takes up space uselessly and is ...
3
votes
1answer
532 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 ...
3
votes
1answer
382 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 ...
3
votes
1answer
32 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? ...
3
votes
1answer
224 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/...
3
votes
2answers
2k views

Summing of individual image's statistic over ImageCollection Google Earth Engine

I have an ImageCollection containing FIRMS fire image in 2014. I want to count the number of fires in the year for a predefined region. I can find a way to count the number of fires for an individual ...
3
votes
1answer
23 views

GEE Download data around buffers on multiplie points, adding coordinates of each point to table

I want to download a time series of the average pixel value of a buffer around a number of points. In the resulting table, I'd like to have the coordinates of each point as a variable. How to do this? ...
3
votes
1answer
50 views

Wrong result while extracting NDVI in Google Earth Engine

I have here a FeatureCollection containing some productive forests of the company I work for. The age in month for each forest site is important to me, since my study only looks for forests that are ...
3
votes
1answer
68 views

Exporting time series data of multipoints in Google Earth Engine

I have created three points of land surface temperature. I want to export the time series result in three different variable names. // Import country boundaries feature collection. var dataset = ee....
3
votes
0answers
399 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 ...
2
votes
2answers
3k 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') ....
2
votes
1answer
325 views

Error generating chart: The image collection is empty in GEE

I am building a Landsat image collection time series and then trying to plot a time series of values for my region of interest by mean reduction. However, upon charting, I get an error message stating ...
2
votes
1answer
98 views

Copying reduceRegion() results to featureCollection properties

I'm calculating a time series for a 7-year period over a grid tessellation AOI. My goal is to have a CSV of zonal statistics for all features in a feature collection from 3 different bands in an image ...
2
votes
2answers
84 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 ...
2
votes
1answer
36 views

Calculating daily precipitation data from CHIRPS over several years using Google Earth Engine

I am still new to the Google Earth Engine and try to calculate the daily precipitation based on the CHIRPS. I have created a code to calculate monthly precipitation. Could you advise me on how I ...
2
votes
1answer
204 views

Translate JavaScript to Python API GEE

I found this code from Google Earth Engine. /* Author: Sofia Ermida (sofia.ermida@ipma.pt; @ermida_sofia) this function mask clouds and cloud shadow using the Quality band to call this function use: ...
2
votes
1answer
383 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 ...
2
votes
2answers
839 views

Max NDVI per month & year using Google Earth Engine to CSV - CSV gives -999 values only

This question refers to Calculating NDVI per region, month & year with Google Earth Engine I have modified the code posted by @Kel Markert at https://code.earthengine.google.com/...
2
votes
1answer
46 views

How can I export a List as a featureCollection in GEE?

I'd like to know how can I export as a featureCollection the List (line 31) of the following script: https://code.earthengine.google.com/5f453a2f3cf39c4be49ac4f4df47ac08
2
votes
1answer
18 views

How to filter ActiveList containing ui.Map.Layers in Google Earth Engine?

How do you filter an activeList of MapLayers in Google Earth Engine (js api)? Context: in an app where users use a dateSlider to visually interpret imagery and assign classifications. Classifications ...
2
votes
1answer
74 views

Google Earth Engine: Calculate milliseconds since epoch from datetime of uploaded shapefile?

I want to get the milliseconds since epoch of thousands of points, each with different timestamps. Here is what I believe I need to do, but my Google Earth Engine knowledge is limited and I can't find ...
2
votes
1answer
70 views

Converting an annual Image Collection into a multiband image in Google Earth Engine

I have an image collection with 35 years of imagery. Each image in the collection represents a measure of annual NDVI for each year from 1985 to 2019. I want to take this image collection and create a ...
2
votes
1answer
308 views

Making seamless and consistent quality of Landsat image after cloud masking and mosaicking/ median composite in Google Earth Engine

I am trying to remove cloud and composite all Landsat 5 TOA images available in a given year and region into a composite of final image. However, I noted that the quality of final composite image is ...
2
votes
1answer
46 views

Making ui.Select out of Feature Collection

I would like to make items/list for ui.Select out of Feature Collection. I have developed a code, but I am receiving an error: . var subset = borders.filter(ee.Filter.eq('GID_0', 'UZB')); var ...
2
votes
1answer
64 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 ...
2
votes
1answer
535 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 ...
2
votes
1answer
21 views

Multiple reduceRegions for time series in GEE js

I want to gather time series data (mean band values) from MODIS for multiple regions, but I want to filter the data so that I exclude images with low numbers of pixels in my regions. Below is the code ...
2
votes
1answer
116 views

Making combo chart in Google Earth Engine

How can I make combo chart in Earth Engine? I have a code that makes a chart based on image collection for given polygon. I would like to draw the mean value line in the chart as well. Is it possible ...
2
votes
1answer
281 views

Scale factor for EVI in Google Earth Engine

I'm new to GEE. I'm working on EVI data analysis. So this is my code for MODIS evi. I want to know how to multiply all the images there inside ImageCollection by scale factor 0.0001 to get real EVI ...
2
votes
1answer
82 views

Default resample method used by GEE when exporting images?

I want to know what the default resample method will be used when I export image like this : Export.image.toDrive({ image: image, description: 'imagetest', **scale: 1000,** region:aoi, ...
2
votes
1answer
54 views

Google Earth Engine chart error: No features contain non-null values of “year” [closed]

I'm trying to plot a chart from a collection I have created. While the data from this collection maps fine, I can't seem to produce a chart for it. Here is the code: var l5_coll = ee.ImageCollection('...
2
votes
0answers
18 views

Dimension Difference preventing plot of series

I have performed linear regression between the 'ro','pr' series (runoff,precipitation) and printed the chart. I want to print the linear fit on top of it and get the R**2 value, but dimensionality ...
2
votes
0answers
41 views

How to get random points from large FeatureCollection without exceeding the user memory limit?

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....
2
votes
0answers
187 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, like mean, std, median, etc. I want to calculate more features based on my ...
2
votes
0answers
64 views

Printing NDWI and NDVI comparision graph

Trying to print the chart for both NDVI and NDWI function addNDVI(image) { var ndvi = image.normalizedDifference(['B4', 'B3']); return image.addBands(ndvi); } ...
2
votes
0answers
154 views

Calculating area fraction of pixels covered by larger pixel using Google Earth Engine

My goal is to calculate an area fraction from one image as the threshold to select (mask)another image. Specifically, the land cover layer has a spatial resolution of 30m and the EVI data is 250m. I ...
2
votes
0answers
274 views

What does Unit-Scale actually do in GEE?

I am experimenting with Google Earth Engine and normalized my images using UnitScale as per this post. When I view the image in the lower pane in Google Earth Engine Code editor and switch the ...

1
2 3 4 5 6