New answers tagged

0

There should be no difference. The .filterMetadata method and similar methods on collections are just shorthand to specify an ee.Filter and apply it to the collection.


0

Your script is training a 20-tree random forest classification model based on 10,000 sample points, which can be slow to complete. This model needs to be trained before either the map is displayed or the image is exported. If you want responsive viewing of the model results (or any other expensive computation), you can export the classified image to a new ...


0

I'we been lead to an easy solution that may be useful to other users. GEE provides the function ee.Terrain.hillShadow that allows to produce a band with 1 where the pixel is illuminated and 0 when it is in the shade, using a DEM. Then you just have to mask your image using the shadowmap. Here is how i used it: var image= ee.Image("LANDSAT/LT05/C01/T1_SR/...


0

The first problem you have is that you have created a collection. //Get the MODIS data var mod_npp = ee.ImageCollection('MODIS/055/MOD17A3'); var mod_npp_only = mod_npp.select(['Npp']); These lines select the Npp band from the collection. (you still have a collection) When you use the .filterBounds() you apply that to a geographical area, but you are ...


2

The issue is that your variable imagedate is of type ee.Date. This means that the variable lives on the Earth Engine Server, not on your browser. It takes a while to wrap one's head around it. But any variable that is declared with the ee. prefix lives on the server and requires ee functions to do manipulations on them. You can't use ordinary javascript ...


1

Assuming your aoi is stored in a variable StudyArea, something like below should work. Remember that loops in Earth Engine is achived via map() and conditionals via filter(). See this guide for more examples. var filtered = ee.ImageCollection('FIRMS') .filterDate('2018-01-01', '2018-12-31') .select('T21') // Create a list of start days var ...


0

The function in the link you provided worked for me. var ROI = ee.Geometry.Point([141.041807, -34.033391]); var kulkurna_A = ee.Geometry.Polygon([ [ [141.045513, -34.031637], [141.045252, -34.031597], [141.045002, -34.031647], [141.044686, -34.031915], [141.044520, -34.032018], [141.040777, -34.035606], [141.040349, -34.036386], [141.041069,...


1

The main difference between getThumbURL and export operations in Earth Engine is that export operations are batch tasks — they are allowed to run longer, whereas ‘thumbnails’ are only suitable for images that are small and fast to compute. You'll get the same content whichever method you use. You will need to specify format: 'geotiff' to get a GeoTIFF ...


1

The output of classified isn't an ImageCollection object, is an Image object (see print(classified);) and this image has only 1 band. You can use either: // Export the image, specifying scale and region. Export.image.toDrive({ image: classified, description: 'imageToDriveExample', scale: 30, region: roi }); or // Export the image, specifying ...


1

Every ee.Geometry object has a method called bounds: bounds(maxError, proj) Returns the bounding rectangle of the geometry. Arguments: this:geometry (Geometry): Return the bounding box of this geometry. maxError (ErrorMargin, default: null): The maximum amount of error tolerated when performing any necessary reprojection. proj (...


1

This a common mistake, since you're new in GEE, maybe you didn't notice it. Once created the visParams object, needs to be called from Map.addLayer() function: Map.addLayer(filteredCollection,visParams); I recommend you to stretch a bit the visualization range: var visParams = {bands: ['B4', 'B3', 'B2'],min:0,max:0.25}; Map.addLayer(filteredCollection, ...


0

It's best to avoid for loops in cases like this. Using the NDWI calculation described here (which is also what you list above) you can map an NDWI calculator to your imageCollection. I had to remove some of your functions that were mapped to the image collection because they weren't defined in the code you provide, but this should give you the general gist ...


0

There are at least two other ways to calculate the NDWI for the image other than the .normalizedDifference function. Here are examples adapted from http://www.malfihasan.com I'm assuming you want the NDWI fomula from McFeeters (1996) using green and near IR bands. // // NDWI expression var ndwiL8 = mosaic_L8.expression( '(G - NIR) / (G + NIR)' , { 'NIR' : ...


0

you can use this code.... // for graph/chart that contain mean NDVI of every year var plotNDVI = ui.Chart.image.seriesByRegion(addnullimages, studyarea,ee.Reducer.mean(), 'nd',500,'system:index') .setChartType('LineChart').setOptions({ title: 'NDVI short-term time series', hAxis: {title: 'Date'}, ...


0

// for graph/chart that contain mean NDVI of every year var plotNDVI = ui.Chart.image.seriesByRegion(addnullimages, studyarea,ee.Reducer.mean(), 'nd',500,'system:index') .setChartType('LineChart').setOptions({ title: 'NDVI short-term time series', hAxis: {title: 'Date'}, vAxis: {title: 'NDVI'...


1

The problem comes from the classifier mode. The default classifier mode is classification mode. Setting it in REGRESSION mode with the setOutputMode solved the issue. Code: var model = ee.Classifier.randomForest({numberOfTrees:10}) .setOutputMode('REGRESSION') .train(train, ...


0

The entire S2 image archive is still being uploaded onto the google earth engine servers which explains the missing S2 data. However, the data is available to download through the Scihub portal if you need access to it https://scihub.copernicus.eu/dhus/#/home.


1

The objects (Most of them, if not all) in GEE are immutable so you'll have to do ... newList = newList.add(mosaic) ...


0

The problem is that the way you are reducing, the inputs to the reducer will be the values of different bands in a pixel. In case of linear regression, it does not work as linear regression is trying to fit a linear equation by minimizing the rmse but one pixel is essentially just a single feature. Think of it this way, to do linear regression you need (x1,...


1

In this section var precipNum = lastPrecip.reduceRegion(ee.Reducer.last(), geom) ... The issue is that lastPrecip is a temporary layer only stored in memory and doesn't have a nominal scale so GEE can't determine the scale by itself. There is a simple solution to this i.e. just specify the scale you want. So the code would now be var precipNum = ...


0

As the suggestion first line indicated: Running command using Cloud API. Set --no-use_cloud_api to go back to using the API And according to the hint the source code imply that '''--no-use_cloud_api''' is used for Disables the new experimental EE Cloud API backend( https://github.com/google/earthengine-api/blob/master/python/ee/cli/eecli.py) Therefore, ...


0

As suspected, I was just making a simple mistake in converting square km to square meters (multiplying by 1000 instead of 1,000,000) when calculating percents.


0

You can calculate the country area from the geometry itself, then use that to calculate share Try this: // Get the forest loss image. var hansen = ee.Image('UMD/hansen/global_forest_change_2018_v1_6') // Load country var country = ee.FeatureCollection("USDOS/LSIB/2013") .filterMetadata('cc', 'equals', 'CD'); // Get the forest loss image. var hansen = ...


0

Looking at the image collection it appears that you the polygons that you are interested in are on the edge of two overlapping landsat scenes WRS_ROW 83 and 84 respectively hence why you are getting two values for each date. To stop this from happening you can filter the image collection by a metadata property by adding in the following line on line 51 of ...


-1

http://www.gisandbeers.com/generar-imagenes-satelite-sin-nubes/ Landsat and sentinel Cloudness mosaic Cloudness mask is similar as obtained with Principe`s Script, but using median instead min().


1

With unweighted reducers (e.g. count) pixels are included if their centroid is in the region. See https://developers.google.com/earth-engine/reducers_reduce_region#pixels-in-the-region


1

I think there is some confusion here regarding what dateRangeContains does. It DOES NOT give you the image closest to the date you want. It just checks a DateRange object in the metadata of an image and gives you images which contains the date you supplied within the range listed in its metadata. The string field is actually supposed to be the name of the ...


0

Regardless of your roi shape the export happens with the bounding box of your roi with everything outside given value of masked value, 0 in most cases. In case of exporting to TFRecords exports it even adds a few padding to make all the patches consistent so that you don't end up with a 256x10 patch somewhere around the edges. So, its done to follow the data ...


0

Because i spend a lot of time to get it working here some details for linux users: Get Google Cloud Software Development Kit (SDK) #Unzip: tar -xvf file you downloaded # Install the gcsdk ./google-cloud-sdk/install.sh # Refresh environment ...


0

i Just found the way to solve the problem, everything is in the following link (google documentation). https://developers.google.com/earth-engine/tutorial_forest_03a


0

I have got the answer for my question today as: var district = ee.FeatureCollection('ft:1PA2zwArj8EsplrX9eMxJ2H_TICyyx855KPnbJhC1','geometry') .filter(ee.Filter.eq('name','Begusarai')); var boundbox = district.geometry().bounds(); Map.centerObject(bbox); Map.addLayer(bbox); Map.addLayer(geometry, {color: 'red'}); print(district); // return the list of ...


1

When you apply the mean, the collection is masked to the filtered path and row, therefore, the bounding box is still the whole collection. My suggestion is to get the first image or the image of your preference in the collection instead of getting the median. Also, bear in mind that the bounding box of the image selected is irregular and you will have more ...


0

I don't see anything unusual here. To explore the data values that are going in to the linear fit, I added a layer with the original values Map.addLayer(statsCollection.select('mean').toBands()); and used the Inspector to look at example pixel values (select the Inspector tab next to Console and then click on a point on the map) Pixels Layer 1: Image (...


0

Don't turn things into lists unnecessarily. I also don't think this is a bug. One of your intersections is null, so that's why you can't set properties on it. Here's a good way to solve that, by allowing map() to return nulls (and drop them): var mapped = vectors.map(function(feat1){ feat1 = ee.Feature(feat1); var mapped1 = polygons.map(function(...


0

I'd recommend using an extra button for adding the county, since you can check if you selected the county you want or not. This is how: var add = ui.Button('add county') add.onClick(function(){ var name = countiesDD.getValue() var county = ee.Feature(counties.filterMetadata('NAME', 'equals', name).first()) Map.addLayer(county, {}, name) }) ui.root....


0

I find a temporally useful way to solve this problem. You can transform the Feature type to List type and use the get function of List type to obtain what you want. The code looks like: // double map over the polygons var mapped = vectors.map(function(feat1){ feat1 = ee.Feature(feat1); var mapped1 = polygons.map(function(feat2){ feat2 = ee.Feature(...


0

The fact that print(mapped.first()) works but print(mapped.first().get('date')) fails even though the former shows a date property, and the error message is about steps that precede fetching the date property, suggests that this is a bug. I will report it.


-1

July 2019, most part of the world (specially Americas) are more than 20 days delayed compared to raw dataset.


2

You can convert the geometry to a feature in a feature collection and export that to the drive. You are getting that error because Export.FeatureCollection does not exist and so there is no property "toDrive" of something that does not exist. The easiest way to do what you want would be var fc = ee.FeatureCollection(geometry4sub); Export.table.toDrive({ ...


3

You can do this by calling the same function on either slider change and then accessing the values from the slider directly from within the function which in this case i've named updateLayer var slider = ui.Slider({ min:-1, max: 1, step: 0.01, style: {stretch: 'horizontal', width:'500px'}, onChange: updateLayer }); var slider1 = ui.Slider({ min:...


0

You could draw a polygon around the right an add it as a region parameter on your export: Export.image.toDrive({ image: yourexport, description: name, scale: 30, maxPixels: 318651567139, region: geometry // the polygon added around the right image });


0

I am quite new to Google Earth Engine but here is the solution I came up nonetheless. Instead of using min() function to composite image, I use percentile. This should reduce shadow captured using min() function while the overall image should not be too choppy (If in the time interval, there is a section where there is no clouds) One thing I want to improve ...


1

Okay I figured it out, I think the image was too large because I didn't define a region to export, so it cut away a part. I just had to draw a square incorporating my whole region of interest and add it to the export command: Export.image.toDrive({ image: LandCoverAgricultureMaskedClip, description: 'Landcover Agriculture in ROI', scale: 500, region:...


1

I had the same problem and it worked when I renamed all the files with the same name as the .zip file.


2

Ok, this is a bit tricky, I assume you want to filter counties by state, so I found a linking property: STATEFP var states = ee.FeatureCollection("TIGER/2016/States") var counties = ee.FeatureCollection("TIGER/2016/Counties") var statesNames = states.aggregate_array('NAME') var getCounties = function(state) { // Given a state get all counties var feat ...


2

As Map.addLayer and Export are client side function, it must be done in the client side, so if you want to do it straight forward, make a simple loop var listOfImages =(withNDVI.toList(withNDVI.size())); var toExport = [1, 3, 4] for (var i in toExport) { var image = ee.Image(listOfImages.get(toExport[i])) // do what ever you need with image Map....


0

Although Nishanta answer is correct if you think in JavaScript, I would like to show you how to do it in the Earth Engine way, which I think is better for this. var list = col_list.iterate(function(img, first){ // cast variables img = ee.Image(img) first = ee.List(first) // same as before but without `getInfo` var dictionary = ee.Dictionary({ ...


0

To adjust the contrast, as you said you want to set the min and max value of visualization to 500 and 8000 respectively, you want to specify those values for the layer. ui.Map.Layer takes visualization parameters as second parameter so you can specify this in your script as function updateMap(selection) { mapToChange.layers().set(0, ui.Map.Layer(images[...


0

To generate layer you need to have a palette on the client side that gets sent to GEE to generate the map. Since you are generating palette based on aggregating a property in a feature collection, the ccgiPalette2 is neither a string nor a list of strings but a computed object type instead. You can use the evaluate or getInfo function to address this. var ...


0

For your first question, I don't think there is a way to change the color of one pixel which is part of a larger image. You can however: (1) change the colors of all the pixels in an image (e.g. by changing the palette, see the documentation here for more info) OR (2) change the value of one pixel in an image, which then will have an effect on the color ...


Top 50 recent answers are included