4 votes
Accepted

Iterate through 30+ years of daily precipitation images to get monthly averages for the whole period

For this case, map month by month I think it's a better approach: var pp_monthly = ee.List.sequence(0, (2021-1981)*12).map(function(n) { var start = ee.Date('1981-01-01').advance(n, 'month'); var ...
user avatar
  • 12.1k
3 votes

Print NDVI Image File Size in Google Earth Engine

Something like the below should work. It figures out the data type of each bands, how many bits used per pixel. Note that it doesn't take file compression into account (and maybe the pyramiding of ...
user avatar
  • 9,635
3 votes
Accepted

Maintaining image id after mapping image collection in Google Earth Engine

You do not need to (and cannot) go through ee.Image lookup by ID to do this. Just copy from the image input: return result.copyProperties(image); For copying the asset ID of the image itself, it's a ...
user avatar
  • 8,726
3 votes
Accepted

Classify is not function using Google Earth Engine JavaScript API

The problem is that you are trying to apply certain ee.Image methods to ee.ImageCollection objects, so the error message is telling you exactly that (... is not a function). The first step to fix the ...
user avatar
2 votes

Calculating snow cover area using MODIS Snow Cover data MOD10A1

First of all, you need to download the documentation from here (MOD10A1-V006-UserGuide_3.pdf). In this document you can see that NDSI_Snow_Cover takes values between 1 and 100. There are also ...
user avatar
  • 26.2k
2 votes
Accepted

How to use "KERNEL_SIZE" in a Google Earth Engine code?

The error is telling you that there is a missing value (i.e., radius) when applying the ee.Kernel.square function, so that means that the KERNEL_SIZE variable does not have an assigned value. Here, ...
user avatar
2 votes
Accepted

NA values on image downloaded from GEE

First, the code it's a little bit untidy (despite it works). For instance: // Compute OSAVI. var addSpectralIndices = function(image){ // Sentinel-2 bands var s2Bands = {'BLUE': image.select('...
user avatar
  • 12.1k
2 votes
Accepted

Google Earth Engine: Calculating image statistics for multiple study regions simultaneously

Use reduceRegions() instead of reduceRegion(). While reduceRegion() accepts a geometry and produces a dictionary of reducer outputs, reduceRegions() instead accepts a FeatureCollection and produces a ...
user avatar
  • 8,726
2 votes

Compressing image before exporting in GEE

As far as I know, GEE exports raster files in two formats: GeoTiff and TFRecord. There are some optional parameters for each format: GeoTiff: 'tiffCloudOptimized', 'tiffFileDimensions' TFRecord: '...
user avatar
  • 12.1k
2 votes
Accepted

Preview all raster within a date range from an Image Collection in GEE

You can do this with client-side iteration. The below script evaluate a client-side array with the collection image ids, iterate over the ids. For each id, the corresponding image is located from the ...
user avatar
  • 9,635
2 votes

Google Earth Engine code for calculating NDWI from Sentinel 2 image collection

// Load an image. var image = ee.ImageCollection('COPERNICUS/S2').filterDate('2017-09-01','2018-09-10'); // Define the visualization parameters. var vizParams = {bands: ['B6', 'B5', 'B2'], min: 0, max:...
user avatar
2 votes
Accepted

How can I display the ID of each image in an Image Collection (Sentinel-2 Level 2A) in Google Earth Engine

After applying a function, the image loses the original properties. maskS2clouds is doing that, not bounds and date filters as you mentioned. The function copyProperties lets you preserve properties ...
user avatar
  • 12.1k
2 votes
Accepted

Google Earth Engine finds Sentinel-3 images with no intersect with defined ROI

As far as Earth Engine is concerned, that image does intersect your ROI. If I run Map.addLayer(band.geometry()); then I get this picture: All of those black pixels in your image are, in fact, ...
user avatar
  • 8,726
2 votes

Installing and importing Google Earth Engine Python API

The problem is that ArcGIS Pro does not handle activate <environment name> in conda the way that it normally operates. I used proswap <environment name> and this corrected the problem, as ...
user avatar
  • 1,739
1 vote
Accepted

Google Earth Engine: extracting pixel values at points from a shape file and creating a table with extracted pixel values and associated point IDs

I think you only need these lines in your code for connecting point_ids to fnf property in respective CSV file: // Export features, specifying corresponding names. Export.table.toDrive(sampled_points, ...
user avatar
  • 26.2k
1 vote
Accepted

GEE: Structure Insensitive Pigment Index time series for multiple polygons

From your script it is not really clear what you are after, but your index computation on your mean image (vegetacion) should look like this: var SIPI = ee.Image().expression({ expression: 'float ((...
user avatar
  • 1,837
1 vote

Excluding images S2 that are not complete in Google Earth Engine

filterMedatada is the function you need. Use .filterMetadata('SENSING_ORBIT_NUMBER','equals', x) where x is the orbit number you want to preserve. Check image metadata if you don't know the orbit ...
user avatar
  • 12.1k
1 vote

Identifying bare soil in agricultural areas using NDVI and Bare soil index in Google Earth Engine

While I'm still not sure exactly what part of the code is not doing what you expect, I did notice your code is quite messy, and that easily leads to mistakes. A few examples: You define your sentinel ...
user avatar
1 vote

Land Surface Temperature in GEE: ,Creating a Chart with correct values

Your brightness temperatures are wrong calculated (see "Conversion to Top of Atmosphere Brightness Temperature" in this document). You need following correction (parameters were obtained ...
user avatar
  • 26.2k
1 vote
Accepted

UI swipe displaying one map instead of two maps for left and right side

There are two issues I spot. First, you probably don't want the crops for 2013 no matter which years you select? var images = { '2013': getCrops('2013'), '2014': getCrops('2013'), '2015': ...
user avatar
  • 9,635
1 vote
Accepted

Google Earth Engine: error when extracting pixels values of chlorophyll and SST for specific coordinates from SMI Modis Aqua

I changed var filterCollect = sitesCollection.filterBounds(ee.Feature(feat).geometry()); to var filterCollect = ee.ImageCollection(sitesCollection).filterBounds(ee.Feature(feat).geometry()); and it ...
user avatar
  • 77
1 vote

Adding a column to a Google Earth Engine feature collection and add names to it using ID

First, since you are new to GEE, I strongly recommend you to look Client vs. Server. I was super lost until I read that guide. So if you're mapping over a ee. object, use server-side functions. First, ...
user avatar
  • 12.1k
1 vote
Accepted

Exporting Google Earth Engine dictionary to CSV

You have to turn your means into an ee.FeatureCollection: var means = ee.FeatureCollection( ee.List( BIandEVT.reduceRegion({ reducer: ee.Reducer.mean().group({ groupField: 1, ...
user avatar
  • 9,635
1 vote

Google Earth Engine - missing share button of assets

If you want to share an asset you need to click on it and the Share button is on the pop-up window that opens, top right.
user avatar
1 vote
Accepted

Google Earth Engine: Separately extracting states with same names from FAO dataset

ADM1_CODE is not a string, but a number. Just remove the quotation marks: var Punjab = admin2.filter(ee.Filter.eq('ADM1_CODE', 1505));
user avatar
  • 1,207
1 vote
Accepted

Adding image property as new band in Google Earth Engine

simple answer: no. The error in your script already tells you that .addBands() requires a constant value so no character/string. See for example: Add a date (day of year) band to each image in a ...
user avatar
  • 1,837
1 vote

Only map NDVI values greater than 0 in Google Earth Engine

It ended up being simple: var maskNDVI = ndvi.gt(0); //set the threshold you need. Here I keep all pixels greater than 0. var maskedNDVI = ndvi.updateMask(maskNDVI); //Apply this in a mask Map....
user avatar
  • 796
1 vote

Export series of images from feature collection

ee.Export is a client side function, so you have fetch the name of the cities and iterate over them. You can do it synchronously using .getInfo or asynchronously using evaluate. My example will be ...
user avatar
1 vote
Accepted

Reducing featureCollection by using group in Google Earth Engine JavaScript API

Basically you want to itirate over the unique identifier, name in your case. and filter all features that match it, compute the mean and overwrite it. This should do the trick: var reduce = fromList....
user avatar
  • 1,837
1 vote

Remap all bands in Image

You need to map over the band names using remap function. For this purpose, use the same scheme for writting a new function var asset = "projects/mapbiomas-workspace/public/collection6/...
user avatar
  • 12.1k

Only top scored, non community-wiki answers of a minimum length are eligible