New answers tagged google-earth-engine-javascript-api
0
votes
Forming a new layer that is the common area between two other layers on Google Earth Engine
So, I was able to solve the issue by changing the geometry l4b.reduceRegion to
print(l4b.reduceRegion({reducer: ee.Reducer.mean(),geometry: mang_district,}).get('MU'));
small change but it helped
0
votes
Concatenating export file name in Google Earth Engine?
This is a classic issue of working with client and server side objects. The problem here is that Export.image.toDrive expects a client side string in the description of the image; however, you are ...
2
votes
Accepted
How to find an the actual value from a band in Google Earth Engine
An image has many pixels with their own distinct values. In order to get one value, you need to reduce those values of the image, combining them according to some operation into one value. This is ...
1
vote
Accepted
How to mask a raster image with classified image class mask?
I think you want .selfMask().mask().
0
votes
Correlation Chart Series Error in Google Earth Engine?
You can't use a multi-input reducer in the chart helper functions. Instead, map the reducer over your inputs and produce a time-series with a single value per date, and then chart that.
0
votes
mosaic.map is not a function
You can not map over a single image. After you calculated the median of your collection, you receive only one image and .map only works with an image collection. When you try to calculate the median ...
0
votes
Invert a raster mask in Google Earth Engine
Inverting the mask can be achieved in multiple ways. But most importantly is that you define the mask correctly, applying .selfMask() in your case doesn't result in your anticipated result. In stead ...
0
votes
Accepted
Pixel-wise max class count for ImageCollection in GEE
There's a couple of ways:
You can map over the collection testing if each pixel is equal to the mode you found, then sum that.
var count = dw.map(function(img) {
return img.select('label').eq(...
1
vote
Accepted
Coefficient of Variation Timeseries in Google Earth Engine
Isn't this just the stddev/mean of each image, plotted?
Something like this:
var result = S2.map(function(img) {
var mean = img.select('ndvi').reduceRegion(ee.Reducer.mean(), geometry, scale)
...
0
votes
Max Pixels error in Monthly NDVI values
Those chart helper functions don't have a maxPixels option. You'll need to use a slightly larger scale to fit in under the maxPixels limit. (60 works)
3
votes
Accepted
Calculate categorical image area based on frequency histogram in Google Earth Engine
You're not specifying a projection anywhere in your code, so
You don't actually know what projection you're using in the reduceRegion calls (probably EPSG:3857 because that's the projection of your ...
1
vote
Accepted
Renaming band names with GeoTIFF in Google Earth Engine
If you want to rename all the images inside your image collection, you need to use the map function. This way you can rename each image with the new names. Additionally, if you look in the Docs ...
0
votes
Renaming band names with GeoTIFF in Google Earth Engine
To rename the bands, you have to use .rename()
var collectionVV = collectionS1.select('VV').rename ('S1_VV_11');
0
votes
Renaming band names with GeoTIFF in Google Earth Engine
Sentinel 1 images are not called 'S1_VV_11' and 'S1_VH_11' as you seem to suggest in your code. Additionally there is currently no way to set names to bands in a geotiff (export): Keeping the actual ...
1
vote
Accepted
Area under curve of Sentinel-2 time-series using Google Earth Engine
I think the most expedite way to do that is by using Simpson method with smoothed values obtained of downloaded CSV chart. It can be accessed with click in the button inside red square of following ...
1
vote
Accepted
Problem in calculating monthly pixel area chart in GEE
The problem is that you are trying to make a chart for an image (ui.Chart.image.series) using a FeatureCollection (monthly). Thus, you need to use the corresponding function to create a chart from a ...
0
votes
Accepted
How to add cloud cover which is an image property as a band in the image collection using GEE Python API
So, basically explicitly renaming the value to a completely different string other than the original name and defining the data type helped
def cloudscore (image):
value = image.getNumber(&...
0
votes
Accepted
How to apply a working GEE code to many line segments with unique ID's (river width application using GSW dataset)
You only have to map list_segment_IDs and export finalOutput Feature Collection as follows. This produces 283*6 (GSW ocurrence) = 1698 records for Segment_ID and Effective_width.
var ...
0
votes
Accepted
Getting User memory error for generation chart
You run out of memory when calculating allAreas. It's expensive to reduceToVectors(), so that's something you want to avoid unless you really need it. If I understand your script correctly, you simply ...
1
vote
How to add cloud cover which is an image property as a band in the image collection using GEE Python API
When getting properties from an image of feature you typically have to cast it to the correct type before using it, or get it as the expected type directly:
value = image.getNumber("...
1
vote
User memory limit exceeded-large shape vector file in GEE
I'm just giving some general advices without reviewing the entire code that, at first glance, could probably be improved in different parts.
I won't go into what is better to achieve your goals, but ...
0
votes
Accepted
Issue in applying condition expression to all band values in Google Earth engine
The issue was in conversion to float values.
var mean = MBUI.reduceRegion(ee.Reducer.mean(),clip_layer,28);
print('mean', mean)
var mean_Img = mean.toImage();
var band_names = MBUI.bandNames();
print(...
0
votes
Adding list to Image Properties using Google Earth Engine JavaScript API
For starters, the images in the collection already contains the acquisition time, through the system:time_start property. It contains millis since Unix epoch. The easiest way to get it as a date is to ...
1
vote
Issue in applying condition expression to all band values in Google Earth engine
The error message is almost certainly accurate. MBUI probably doesn't have a B3 band. But your code isn't complete enough to say.
As for the expression, to do power, you don't use ^ but **. It also ...
1
vote
Empty band list in NAIP data
Information related to 'USDA/NAIP/DOQQ' Image Collection in this link, reveals that availability is between 2002-06-15 and 2020-12-17. So, this explains your empty band list for your dates range .
...
0
votes
How to create an Image Collection
Your code is fine. First of all, you are searching in the wrong place. You should watch in band list of whatever feature of 4800 elements of the ImageCollection; as it can be observed as follows. Each ...
1
vote
Accepted
Is it possible to extract pixel values for multiple image layers at specific locations?
Combine the two images' bands into one image. Then, you will get only one set of points.
var samples = drain.addBands(elev).sample({
region: fromList,
geometries: true,
scale: 90,
});
(You may ...
0
votes
Error: "l8.filter is not a function"
Here is where you are calling l8.filter().
var img = l8.filter(ee.Filter.eq('year', parseInt(year, 10))).select(m.imgInfo.bands[band].bname);
This and other parts of the code make sense if l8 is an ...
1
vote
Area calculation doesn't make sense: smaller raster has higher area
I don't understand why, but figured it out. The issue is the way I'm "merging" the 4 crop rasters from Mapbiomas of different years. As they all are coded as 1, I was summing them up to get ...
1
vote
Accepted
Combine a Number and String in Google Earth Engine Java Script?
By using exclusively GEE class methods, following script works as expected:
var number = 0.2;
var val2 = ee.Number(number).format().slice(2);
print("val2", val2);
var string = 'test';
...
0
votes
Landsat 9 Image Collections are not producing any images from July 7th to the present. Why is this?
The USGS site which publishes Landsat images has been down for planned maintenance this weekend (and has been having problems in the last couple of weeks).
Once the images are available there, they ...
0
votes
Getting Memory limit error in chart generation
As your image collection only have 501 images, I think that the issue is in the feature collection named as ROI (not available for me). So, I assumed as your ROI a relatively large area in Pakistan ...
0
votes
Google Earth Engine: Understanding Landsat 7 Collection 2 QA_PIXEL, bitwiseAnd() for cloud mask
It seems that like your logic for producing the mask is wrong because you are considering dilated cloud AND cloud. It should be the OR operator, no?
var mask = qa.bitwiseAnd(dilatedCloud)
.or(qa....
0
votes
How to visualize image from imagecollection
You are mixing up different object types. So multiplying numbers and images in your case, you can't mix them up in earth engine. For example:
var S1 = ee.Image((ee.Number(1).divide(ee.Number(4)....
Top 50 recent answers are included
Related Tags
google-earth-engine-javascript-api × 775google-earth-engine × 746
javascript × 43
sentinel-2 × 35
ndvi × 33
google-earth-engine-python-api × 26
modis × 25
raster × 24
export × 24
image × 18
landsat × 17
geemap × 16
chart × 15
time-series × 14
feature-collection × 14
classification × 13
reducers × 12
landsat-8 × 11
remote-sensing × 10
filter × 10
random-forest × 10
coordinate-system × 9
function × 9
google-earth × 8
image-mosaic × 8