3
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 ...
2
votes
Accepted
How to include empty classes in reduce.Region in Google Earth Engine?
Convert the groups to a dictionary and combine the result for each region with a dictionary of defaults.
// Create a dictionary of defaults.
var defaults = ee.Dictionary(ee.List.sequence(1, 8).map(...
2
votes
Accepted
EarthEngine: how to rename output of reducer, with multiple bands?
In both reduceRegion and reduceRegions, single input reducers are automatically replicated to match the number of input bands (by explicitly calling forEachBand() for you, automatically).
When that ...
2
votes
Accepted
Calculating monthly Modis NDVI using GEE Python API applied to one or multiple regions and exporting results to Pandas DataFrame
A good approach (based on a personal question, similar to this one) is mapping over month value, adding one month for each iteration.
Since you want a dataframe output, I see no need to use two ...
2
votes
Accepted
Get zonal statistics given polygon from 3-bands raster using Rasterstats
Found a way to do this, using the "band_num" variable, and running once per bands:
stats1=zonal_stats(gdf, url,stats="median",band_num=1)
stats2=zonal_stats(gdf, url,stats="...
2
votes
Accepted
ReduceRegions "Image.reduceRegions: Computed value is too large. (Error code: 3)" in Google Earth Engine
When having a lot of regions, instead of using reduceRegions(), it's often better to map over them and do reduceRegion() for each of them. That way, EE can split up the work better. I still doubt you'...
2
votes
EarthEngine: how to change pyramiding policy to mode for a "sum" reduction?
I think you're right that the images weren't ingested with the correct pyramid policy. The ingestion process is irreversible, so you can't fix this without re-uploading the data (or exporting at ...
1
vote
Accepted
How to map a grouped reducer over a feature collection
You can use reduceRegions() for that.
var lossByYearCollection = lossAreaImage
.addBands(lossYear)
.reduceRegions({
collection: aoi,
reducer: ee.Reducer.sum().group({groupField: 1}),
...
1
vote
GEE error while running reduceRegion: GEE Error: Provide 'geometry' parameter when aggregating over an unbounded image
That issue is produced due bad geometries in dataset Feature Collection. That was already considered here. However, there are another issue related to soilmoisture Image Collection. You need to use a ...
1
vote
GEE: applying a group reducer over an image collection
There are two things you should consider to run properly the desired process: 1) you'll need to put the result from reduceRegion inside an Feature object without a geometry (i.e., simple table) so the ...
1
vote
Accepted
GEE ee.Reducer.mode returning float values when input is integer
For a large number of inputs, the mode is approximated from the histogram. You may be able get exact values by ensuring that maxRaw is at least as big as the number of pixels in the region at the ...
1
vote
Accepted
How would I calculate the sum of the values of a band around a specific pixel in Google Earth Engine?
There are several ways to do this. You can for instance use reduceNeighborhood() to calculate the sum around all the pixels in the image, controlling the "geometry of the region to reduce" ...
1
vote
Accepted
Extracting band values of an Image Collection over a point shapefile in GEE
If you want to export the data, you can select the features you need in this way:
Export.table.toDrive({ collection: ptsStats,
description:'ExtractedValuesofPoints',
fileFormat: 'CSV',
...
1
vote
Accepted
Calculating number of days where a condition is met over multiple regions in Google Earth Engine
I didn't actually find any occurrence where the wind speed was larger then 25 m/s in 2015 in Colombia. The max value was 15.6 m/s:
https://code.earthengine.google.com/f950e2211be6b75519553a0003281ea8
...
1
vote
Accepted
ReduceRegions not returning values in Google Earth Engine
I don't usually work with Python so I worked out a solution directly on the GEE code editor. From what I can gather, there are two things that are messing up your code:
First, I think you might have ...
1
vote
Accepted
What is the default zoom level for Google Earth Engine kernels using the Python API?
“Zoom level” is a description that makes the most sense when you're viewing an interactive map. But it's just another perspective on the fundamental concept which is the requested pixel resolution of ...
1
vote
Google Earth Engine reduce region
reduceRegion() expects a geometry, not a collection. Whenever you pass a collection where a geometry is expected, all of the collection's features' geometries are retrieved and unioned.
So, all of the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
reduceregion × 40google-earth-engine × 34
google-earth-engine-python-api × 8
reducers × 8
google-earth-engine-javascript-api × 6
zonal-statistics × 4
export × 3
land-cover × 3
mean × 3
python × 2
r × 2
modis × 2
feature-collection × 2
map-function × 2
qgis × 1
raster × 1
area × 1
spatial-statistics × 1
ndvi × 1
landsat × 1
filter × 1
geopackage × 1
extract × 1
function × 1
null × 1