New answers tagged

2

I saw you posted this question in Stack Exchange here: https://stackoverflow.com/questions/70822169/reducing-a-region-in-google-earth-engine-error-for-classification/70828923#70828923. In case you missed it, here is my reply: It looks like the AOI you are trying to calculate over is too large. You will want to either make the AOI smaller, reduce the scale of ...


3

According to the reference that appears in the citations tab of the CHIRPS dataset (https://www.nature.com/articles/sdata201566), the data is "quasi-global (50°S-50°N)", so that is the reason why there is no data north of 50°N.


1

After changing your script according to Matt's comments, it looks like your min and max ranges are set incorrectly. In the "Layer" menu on your map visualization, you can set the symbology range to "Stretch: 100%" to see the full range of the data. From there, you can "Import" the new visualization parameters into your script, ...


0

I am unable to access the table, likely because of permission settings. Please make sure that the table is shared so that "Anyone can read". Additionally, your syntax for importing the table data is wrong in this script. currently your table variable is a string. To call your table data, you will need to use ee.FeatureCollection('users/...


1

You are applying an image function (.gt()) to an image collection. So you have to select an image, or map the logic in a function over the entire imageCollection. Here is the solution to applying it to an image: var ndviImage = ndvi.first() // now it is an image var ndvi2 =ndviImage .where(ndviImage.gt(0.27).and(ndviImage.lte(0.36)), 4) ....


1

Try reducing the scale; you're currently using the reducer at 1 degree (~110km), which is much larger than the size of your geometries: print(imgCol.first().projection().nominalScale()) 111319.49079327357 Setting the scale to 30 meters (the scale of bands B2, B4 and B5), fixes the issue: var reducer_mean = ee.Image(stacked_image).reduceRegions({...


0

For the error "User memory limit exceeded" I need to change the machine. I could not find another way. Also, making a subsample could work, but it is not the same to work with a fraction of your big data, you always keep wondering what would happen if I use the entire database.


1

Probably the easiest and most straightforward solution is to remove the leading zero from the month property by .format('M'); var monthly = ee.FeatureCollection( ee.List.sequence(0, monthCount.subtract(1)) .map(function (monthsOffset) { var start = startDate.advance(monthsOffset, 'months') ...


0

Apparently, this is rare but does happen. You need to create a new repo folder and copy your scripts into the new folder.


3

You can try converting the image collection to bands in a single image. I just tried the following code and it took around 10 minutes to export to Google Drive. var era5_2mt = ee.ImageCollection('ECMWF/ERA5/DAILY') .select('minimum_2m_air_temperature') .filter(ee.Filter.calendarRange(1990,2020,'year')) ...


1

You're correct that the problem is that there's no LST for some dates. The actual error is coming because you're attempting to get() from the first() item in a collection of 0 length. You can avoid all that. Use reduceRegion(), not sample() (since you don't need each point to generate a collection), and just assign the reduceRegion results (a dictionary) ...


-1

Use of ee.Reducer.firstNonNull() will make sure to assign values first non null values from the list. You can then filter out all -9999 values. The updated lst function should be as below var lst = function(feature) { var date = ee.Date(feature.get('Time')); var lst = lst_main.filterDate(date, date.advance(feature.get('Time difference'), 'months')); ...


0

Error is produced because mndisi is an image and you are using 'filterDate' for Image Collections. Your code works with this modification. //Create Monthly Plotting Chart Terra var months = ee.ImageCollection( ee.List.sequence(0,n_months).map(function(n){ var start_month = start.advance(n,'months'); var end_month = start_month.advance(1,'month'); ...


4

Your property 'orthofoto' is a computedObject, not an image. You can specify the property as an image by: var orthofoto = ee.Image(listOfImages.get(1)) Alternatively, if it works for your project, you can take the mean of the dataset using dataset.mean() and use that for sampling. Of course, this means that you're sampling across the entire date period and ...


2

The forEach function that your original code is using, is a client-side function on Javascript arrays/lists. You cannot use it on server-side objects. In your original code, you have a client-side javascript list. In the second code, you've turned it into a server side list. The only way to use the server-side list in a loop like you're using, is to ...


1

Another way would be by using groupReducers var dataset = ee.ImageCollection("ESA/WorldCover/v100").first(); var areaImage = ee.Image.pixelArea().addBands( dataset) var areas = areaImage.reduceRegion({ reducer: ee.Reducer.sum().group({ groupField: 1, groupName: 'landcover_class', }), geometry: area, scale: 10, ...


3

Here is the Python equivalent of your function: def addEVI(image): EVI = image.expression('2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', { 'NIR' : image.select('B8').divide(10000), 'RED' : image.select('B4').divide(10000), 'BLUE': image.select('B2').divide(10000)}).rename('EVI') return image.addBands(EVI)


0

Found the solution: the issue was that the input feature collection was in a different projection to the projection I defined in the coveringGrid() function. If you're using this function, make sure to use ee.Algorithms.projectionTransform() on the input feature collection to make sure that the crs of the input is the same as the one defined in coveringGrid()...


0

Some considerations: It's redundant the use of ee.Image() and .first(), since the output of the second one is an ee.Image object. Check .first() description: Returns the first entry from a given collection. This function returns the first image of your image collection, so can't be used for mosaicking purposes, since you need more than one image. There ...


2

You are using the wrong collection for calculating the mean (based in your former question). It is terra_mndwi; not terra_SR. There are other errors adding bands and mapping collections. Following code fixes all issues. var jawa = ee.FeatureCollection("projects/ee-tugasakhirkkh/assets/Daerah_Penelitian"); Map.centerObject(jawa,7); //Define ...


3

The problem is functions order. First, you add LST band, then you compute MNDISI. Also, this chunk won't work: .map(function(img){ return img.addBands(terra_LST.filter(ee.Filter.eq('system:index',img.get('system:index')))) }) You are mapping addBands() function trying to add bands from an ee.ImageCollection, it should be ee.Image type. No worries, ....


Top 50 recent answers are included