Questions tagged [reducers]
The reducers tag has no usage guidance.
96 questions
8
votes
1
answer
3k
views
Multiple reducers Google Earth Engine
How can we apply more than 2 reducers to an Image?
The following link shows for 2 reducers
https://developers.google.com/earth-engine/reducers_intro
But the following won't work:
// Load a Landsat ...
5
votes
1
answer
998
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 ...
5
votes
1
answer
789
views
ReduceRegions not writting to feature properties in GEE
I am trying to apply reduceRegions() to extract average precipitation from the TerraClimate dataset within each polygon of a feature collection. The problem is that the output of the reduction is not ...
4
votes
1
answer
347
views
Retrieve projection inside .map() GEE
When using a reducing function such as .reduceRegion(), a provided projection is necessary.
This projection has to be provided as CRS String, and crsTransform List. Both are optainable with :
var ...
3
votes
1
answer
960
views
Correlation coefficient and R squared in Google Earth Engine
I want to calculate the correlation coefficient and R squared between two bands for two different images. How should I proceed?
var s1_float = ee.ImageCollection("COPERNICUS/S1_GRD_FLOAT"...
3
votes
2
answers
1k
views
Combining grouped reducers in Earth Engine
In Earth Engine, one can easily apply a same reducer to multiple band in an image. Unfortunately, it seems that this nice feature breaks if one uses a grouped-reducer?
repeat() will work if one seeks ...
2
votes
1
answer
1k
views
Calculating R-Squared Using the 'Residuals' Band from Google Earth Engine's linearRegression() Reducer
I am trying to calculate an R-Squared for a harmonic linear regression I did with two dependent variables across an image collection, using the linearRegression reducer on Google Earth Engine. The ...
2
votes
1
answer
1k
views
Count number of NULL values per region in Google Earth Engine
Following a previous post I now have some code which sets null values in an image collection to zero.
I have used this code on several variables, however, I'd like to know which variables have NULL ...
2
votes
2
answers
1k
views
earthEngine: count number of fully covered pixels within a region
I would like to count the number of pixels that are fully covered by a given region/geometry. How can I do that? Using standard reducer, I can get:
ee.Reducer.count() will just count the number of ...
2
votes
1
answer
853
views
Geometric median image compositing in Google Earth Engine
I am trying to make an image composite from Landsat 8 collection 2 based on Geometric Median (GM) algorithm. This is another option (like median or medoid) for creating a composite for time series ...
2
votes
1
answer
4k
views
Difference between reduce(ee.Reducer.mean()) and mean() for ImageCollection in GEE
I am working with S5P data for NO2. I have an image collection and want to obtain the mean NO2 for specified filters. The following code is from the documentation.
var collection = ee.ImageCollection('...
2
votes
1
answer
2k
views
Count pixels inside a polygon with Google Earth Engine
i'm pretty new on GEE, so i hope someone can help me with this. As the title say, i'm looking for a way to calculate how many pixels i have inside a polygon. I tried to do it with reduceRegion and ee....
2
votes
1
answer
214
views
Reduction over an image collection Google Earth Engine
I am using CHIRPS data set (daily precipitation) to derive mean, median, min and max precipitation within a certain time frame. Then, I want to extract the values at specific locations included in a ...
2
votes
1
answer
306
views
Making a choropleth map from zonal statistic in GEE
I have counted pixels with NDVI more than 0.2 for each polygon in a shapefile. Now I want to create choropleth map showing counts of pixels in each polygon. I want to how to create choropleth map ...
2
votes
1
answer
153
views
Getting maximum value of a cumulativeCost Image in Earth Engine
I'm trying to get the max value of a generated cumulativeCost Image in Earth Engine, via the Python API. I thought reduceRegion should work, but it dies.
My relevant code:
malawi = ee....
2
votes
1
answer
72
views
Cannot get canopy height from dataset
I just can't work out why this reducer does not work and give me the average canopy height. The reducer output is null even though there are pixels in the area.
var fromList = ee.FeatureCollection(&...
2
votes
2
answers
55
views
What does GEE do with mode ties?
What does Google Earth Engine do with tied values when calculating the mode, in any context (for example, using ee.Reducer.mode, or ee.ImageCollection.mode)?
If there are an equal number of two values,...
2
votes
1
answer
829
views
Create one histogram for S2 ImageCollection in Google Earth Engine
I'm trying to compute ONE histogram for an entire ImageCollection in Google Earth Engine (example code here: https://code.earthengine.google.com/b10f5136a79a6309e381ae11aa9b7431)
What I'm doing now to ...
2
votes
1
answer
680
views
Mapping over a reduceRegions command in Earth Engine
I have a feature collection of about 80,000 tiles, and I am trying to calculate the annual maximum drought severity index score for each tile using TerraClimate data. TerraClimate is an image ...
2
votes
0
answers
325
views
How to reduce 2 image bands simultaneously using grouped sum region reducer in GEE
I am trying to reduce a region to simultaneously obtain forest loss and forest cover by year from the Hansen dataset. I have tried doing this using a grouped reducer, however, I get the following ...
2
votes
0
answers
418
views
Reduce regions on projected (equal-area) data in Google Earth Engine
I am working with a global raster of soil carbon and a feature collection of ecosystems. I would like to average the carbon in each ecosystem using ReduceRegions in Google Earth Engine, but I need to ...
2
votes
1
answer
67
views
Scene boundary issue when reducing sentinel 1 in natural values vs dB
I have written a function that smooths sentinel 1 images by reducing across clusters created from a sentinel 2 median image, and then reduces the sentinel 1 collection to the p5 value. When I run the ...
1
vote
1
answer
1k
views
Google Earth Engine data extraction from imagery
I am trying to extract Landsat values at a number of points using Google Earth Engine (Python API). My points are given to me in the NAD83 system (as a CSV dataframe).
How can I extract a 3x3 grid of ...
1
vote
2
answers
724
views
Reducing every image in collection using Google Earth Engine
I want to reduce every single image in a collection, but I have not been able to make it. The process is really easy and works with a single image, but I need to do the same for every image in the ...
1
vote
1
answer
811
views
Count number of pixels within polygon that have a particular range of values in Earth Engine
I am working with the Global Forest Cover Change (GFCC) rasters for 2000 to create a forest quality score for 0.01 degree tiles (the percent of the tile with +50% forest cover, divided by the percent ...
1
vote
1
answer
269
views
Server-side alternate to `ee.List.getInfo()` for running a loop
I have a GEE-python code which first extracts the distinct pixel values and then aggregates the area of all such pixels within the adminitrative boundary. However, when running this function for big ...
1
vote
1
answer
812
views
EarthEngine: how to rename output of reducer, with multiple bands?
I would like to change the output name of a reducer, ideally by appending "_prefix" on each band. setOutputs() function does it (partially) when there is only one band, but not when there ...
1
vote
1
answer
207
views
Generating feature collection from image band statistics
I'm trying to calculate the percent forest cover for 125 basins using the MapBiomas 30m land cover product for Brazil. The data is provided as an image with band values for each year. When I try to ...
1
vote
1
answer
380
views
Reducing MODIS MOD16A2 evapotranspiration over a season
As per IMD, there are 4 seasons over India which are viz
winter (January-February),
pre-monsoon (March-May),
summer monsoon (June-September),
and post-monsoon (October-December).
GEE Javascript API ...
1
vote
1
answer
744
views
Extracting data in single query from multiple Google Earth Engine images
I am trying to extract a number of variables at a series of points (lat, lon, time) by intersecting multiple images and image collections with those points (e.g. Landsat images and elevation raster). ...
1
vote
2
answers
769
views
Google Earth Engine memory capacity exceeded
I am trying to export to a csv table with total precipitation per month-year per polygon (~5571 polygons) from 2001-2019 (228 time steps). I am using the CHIRPS dataset (daily data) so had to reduce ...
1
vote
1
answer
2k
views
Calculating zonal statistics for each polygon in shapefile using GEE
I have shapefile of counties and want to calculate mean NDVI for each. I know reducing connected components and ee.reducer.mean can be helpful in GEE but it wants it as CSV for further analysis in R ...
1
vote
1
answer
484
views
How to find top 10 greatest values in a GEE image collection?
I'm trying to categorize temperature extremes for a region. Using the Hycom GEE dataset, I know that using a Reducer I can find the maximum value for each pixel across the image collection (see code ...
1
vote
1
answer
2k
views
How to read minimum and maximum pixel values of an image in earth engine?
I want to read the minimum and maximum rainfall value for my study region. While using the reducer function I can read the mean value, however, for min and max value it is showing null. I wish to ...
1
vote
1
answer
27
views
GEE function to apply annual reducer for multiple years in image collection
I'm working with a GEE image collection that includes multiple images for each year
var studyRegion = ee.FeatureCollection("FAO/GAUL/2015/level0")
.filter(ee.Filter.eq("ADM0_NAME", ...
1
vote
1
answer
84
views
Transposing the output of a CSV from rows to columns in Google Earth Engine
var aoi = ee.FeatureCollection("users/jrobertsonpanthera/surveyed_grid_3test")
// Hansen Data
var gfc = ee.Image('UMD/hansen/global_forest_change_2022_v1_10')
var lossImage = gfc.select(['...
1
vote
1
answer
883
views
Getting output from reducer (frequency histogram) for every polygons in feature collection using Google Earth Engine
Context:
I'm trying to calculate forest cover for each districts in a province. I used the reducer function (frequency histogram) on a raster, using a feature collection object as its "cookie ...
1
vote
1
answer
445
views
Standard deviation map shows pixels as null in GEE
I need some help in understanding image reducing with kernels.
I have a code that generates a band of NDVI stdDev 3X3 kernel. When I map the layer the outcome is an image with empty pixels with a ...
1
vote
1
answer
189
views
Earth Engine: different results with "covariance" and "centeredCovariance" on de-meaned data?
I am trying to compute a covariance matrix in earth engine. EE offers two reducers:
ee.Reducer.centeredCovariance
ee.Reducer.covariance.
My understanding is that ee.Reducer.covariance on the raw ...
1
vote
1
answer
791
views
Error when trying to add system:time_start when using reduceRegions in Google Earth Engine
I am reducing an image collection into a feature collection by using a function to map the reduceRegions function to each image in a collection. I'm trying to make sure the system:time_start property ...
1
vote
2
answers
689
views
FeatureCollection (Error) Image.reduceRegions: Group input must come after weighted inputs
I was trying to find the area of each block by category in the band. There is one band and it has 18 categories. The feature collection is a collection of blocks described uniquely by code_2011.
var ...
1
vote
1
answer
701
views
Earth Engine: combining reducers does not give same output as running reducers separately?
I am trying to combine reducers, which according to my understanding, is running parallel yet independent reducers when using sharedInputs: true (see doc). But actually, I notice that with combine(), ...
1
vote
1
answer
20
views
Mean Copernicus landcover in multiple polygons with reduceRegions
I would like to estimate the average tree cover for each polygon of a Feature Collection, but the code below only returns empty values. I have tried using different Image Collections (like EVI) and ...
1
vote
1
answer
362
views
Google Earth Engine: reduceRegion on multiple bands of daily aggregates
I found this hourly climate-dataset in the GEE catalog, which I want to utilize, to get the daily mean value for six different bands for the time between 2017 and 2022 based on one user-defined AOI (...
1
vote
0
answers
229
views
Image reduced by neighborhood in Google Earth Engine appears different in QGIS
I have a classified sentinel 2 image. To remove single pixel outliers I have applied ee.Reducer.neighbourHood() which essentially smoothens the image with a mode reducer. Finally when export the image ...
1
vote
0
answers
76
views
Visualization and vectorizing for AI in Google Earth Engine
I'm glad to find this space, I come from a background in economics and do not know the first thing about GIS (hope to learn as I go with this project).
I found an interesting dataset (https://...
1
vote
0
answers
219
views
How to calculate sum of night light radiance for each feature in a feature collection?
I have a shapefile which contains 36 polygons (districts/counties). For each district, I want to calculate sum of lights (as well as count total number of pixels). I tried following code but failed. ...
1
vote
0
answers
541
views
ERA5-Land Hourly Precipitation Chart and Map
I am little bit confused how to handle the "ERA5-Land Hourly"-Dataset in GEE. I want the total precipitation of every month from 2018 till end of 2021 for my area.
For the chart I took the ...
1
vote
1
answer
96
views
How to reduce an image resulting from an expression?
In the code below I use the ee.Image.expression method to combine two images into one. I am then able to display the resulting image using geemap, and the image looks as expected. However when using ...
1
vote
0
answers
244
views
Can you create a custom reducer?
For a specific size of area (e.g. 1km squared), I want to apply formulas to a feature collection.
These formulas aren't included in the reducers available. For example, I want to get the circular mean ...