New answers tagged

2

There's a 4GB limit built into the GeoTIFF standard. So large outputs have to be split into pieces smaller than that.


1

The problem was that the asset I was trying to delete is an ImageCollection! To delete it, one needs first to delete each image individually before deleting the ImageCollection. To do so in the Java GUI: Click on the asset details Go to Images, delete each image (trash icon) Then use the Delete button Alternatively, if one uses the earthengine command line,...


1

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(function(n) { return [ee.Number(n).format("%d"), 0] }).flatten()) // Convert a grouped reducer output to a dictionary var convert = function(groups) { ...


0

How dark the image look on the map depends on how it's been stretched. You left that code out of your question. I transferred your script to the EE Code Editor and added the pan-sharpened image to the map, stretching it like I'd normally do. It looks good. Map.addLayer(satellite_imagery, { bands: 'red,green,blue', min: [.02, .04, .06], max: [.24, .22, ....


1

You can use the style argument when creating your ui widgets and use a subset of CSS to style them them. There are some missing features, like the border-collapse property, that makes it tricky to get pixel-perfect styling. Here's a starting point, which should point you in the right direction: var classNames = ['City', 'Water', 'Forest', 'Other'] var ...


0

As soon as you encounter a masked pixel when accumulating your value, the result will be masked. var added = img.add(previous) To workaround that, you could unmask img to the value 0 var added = img.unmask(0).add(previous)


1

Your code has a lot of issues, however, as you only are interested for generating the MSAVI trends and image output (with 115,252 individual images in dates range) for your large study area ('Laikipia' county in Kenya is in "FAO/GAUL/2015/level2" FeatureCollection), I could fix them as follows. var dataset = ee.FeatureCollection("FAO/GAUL/2015/...


1

“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 the image. For example, if you've specified 600 nominal meters per pixel in reduceRegions(). Thus, if the kernel were used in that image, it would be (150,000 ...


1

Sentinel-2 Level-2A has the following specification: Dataset Availability 2017-03-28T00:00:00 - Although Sentinel-2 Level-1C is available since mid-2015, the atmospherically corrected product is only available in GGE from 2017 data. Sadly, the workaround for this issue is to download L1C products and use Sen2cor for getting L2A scenes (or apply EVI to L1C ...


0

This is possible in theory, but not necessarily a good idea. EE is great at working with large amount of pixels but less good at working with complicated features. To do this, you turn your image mask into a FeatureCollection, using reduceToVectors(). This works for simple and small images, but will be problematic for more complicated ones, resulting in a ...


0

You can do this with some array image fiddling. That's always a bit tricky, and not very easy on the eyes. To understand the code in detail, I suggest that you add the intermediate array images to the map and inspect, to see what they contain. var anomYearArray = anom .toArray() // Convert collection to 2D array image var anomArray = anomYearArray....


1

Here's a stab at solving this. For the east-west case (north-south is essentially the same): An image where each pixel represent the distance to the point is combined with the LST band, pixels not on the east-west line are masked out, and features with distance and LST are created for every non-masked out pixel. var image = lstAdded_2019.first().select('LST')...


0

The values seem to be correct, maybe you intended to filter to the months 5-9 instead of the days 5-9? .filter(ee.Filter.calendarRange(5,9)) This by default takes the calendar Range from the 5th of January to the 9th of January which generally have temperatures below freezing. If you change it to: .filter(ee.Filter.calendarRange(5, 9, "month")) ...


0

It's the way you use a geometry (hand drawn) versus what the custom function is expecting. I assume. But this works: var batch = require('users/fitoprincipe/geetools:batch'); batch.Download.ImageCollection.toDrive(dataset, 'Folder', {scale: 10, region: geometry, type: 'float'}); Although chrome will ...


0

You can check the type of image, the code may need image = ee.Image(image) before computing NDWI.


1

In the most basic way, you want to initialize drawing tools for your map. Then you can access geometries drawn with those drawing tools using layers(). From there you can convert them to geometries and pass them to the region parameter. // This sets the available draw modes. point and line would also be available c.map.drawingTools().setDrawModes(["...


1

You need to set geometries to true in stratifiedSample(). Otherwise, the samples will not include the geometries, and you cannot put them on a map. If you print your points, you'll see that the features miss their geometry. You also have some issues with variable names, and that flatten() call on the points - that causes an error, since you don't actually ...


0

i solve the problam as follow: var aaa = /* color: #d63000 */ee.Geometry.Point([30.0787, 37.5219]); var geometry=geometry2 // Applies scaling factors. function applyScaleFactors(image) { var opticalBands = image.select('SR_B.').multiply(0.0000275).add(-0.2); var thermalBands = image.select('ST_B.*').multiply(0.00341802).add(149.0); return image....


1

You create a median composite from your Landsat imagery, and calculate the vegetation area in that composite. Instead, you can map over the image collection, and calculate the vegetation area in each image. Note that clouds in individual images will effect your vegetation area. var ndviImagery = ee.ImageCollection("LANDSAT/LT05/C01/T1") ....


0

Earth Engine does not truncate field names except when necessary. I'm guessing you are exporting in the shapefile format — shapefiles only support 10-character field names. To avoid this problem, export using one of the other supported formats, such as CSV or GeoJSON.


0

You need to call the specific function and iterate over the image collection using .map() function: var cloud_masks = require('users/fitoprincipe/geetools:cloud_masks'); var sentinel2function = cloud_masks.sentinel2(); var col = imageCollection.map(sentinel2function); Map.addLayer(imageCollection, {bands:['B4', 'B3', 'B2'], min:0, max:5000}, 'test image');...


0

Here is a downside: >>> numpy.nan == numpy.nan False >>> numpy.isclose(numpy.nan, numpy.nan) False I'm using a python program that does raster algebra and it smartly tries to mask out nodata values using equality checks like these, so the math only operates on valid pixels. If numpy.nan is the nodata value, the masking will fail and we'll ...


1

You could map over a list of years: var fall_mf_collection = ee.ImageCollection( ee.List.sequence(1982, 2020).map(function(year) { year = ee.Number(year) return final_col .select('ndvi', 'time') .filterDate(ee.Date.fromYMD(year, 9, 22), ee.Date.fromYMD(year, 12, 22)) .reduce(ee.Reducer.percentile([80])) .set('year', year) }...


0

I had a similar problem and I solved it with a function to be applied to the image collection. I adapted it to your code, I hope it works for you too. var area = ee.Geometry.Polygon([[8.647458, 44.659079],[8.588429, 44.658882],[8.587969, 44.723788],[8.647064, 44.723985]]); /**FUNCTION to MASK CLOUDS using the Sentinel-2 QA band @param {ee.Image} image ...


1

If you're asking to directly access the the high-resolution satellite and aerial imagery from Google Earth and use it for analysis in Earth Engine, then unfortunately the answer in almost all cases will be that it's not available for free in Earth Engine. As the other answer alluded to, most of the imagery in Google Earth & Maps is commercially provided ...


2

You are mistaken about test2; it is working, you are only looking at 1 image, in a small region where that image has roughly the same value. If you zoom out, or inspect the entire collection, you'll see variation. However, your math is equivalent to dividing by -100 and taking the ceiling; that would be much faster & easier. return img.multiply(-1)....


2

You've taken too many steps. Once you've called geometries(), you've turned it into a list, and getting back from there is tough if they're not all the same type. Just dissolve the table's geometry directly. var geoLeyte = table.geometry().dissolve() That said, the resulting geometry is pretty big, so you're probably going to run into problems using it. ...


0

The error already tells you what your problem is, you can't print that amount of information from the server side your console (client-side). Read the debugging guide on the earth engine developers website: https://developers.google.com/earth-engine/guides/debugging?hl=en


0

You are going to need a mapped function to do what you want: var Traco_area_collection = s1.limit(50).map(function(i){ var image = ee.Image(i).select("VV"); var flooded_image = edgeOtsu(image,kwargDefaults); var imgAarea = flooded_image.multiply(area).select([0]); var imgAarea_ha = imgAarea.reduceRegion({ reducer:ee.Reducer....


2

For preserving classes and original color palette of MODIS product (in only one band), you can try following code. Your selected classes (13 and 15) represent small or nonexistent areas (for Snow and ice, class 15) so, I chose, instead, following three classes values: 2 (Evergreen Broadleaf forest), 9 (Savannas) and 13 (Urban and built-up). var ecoregions = ...


2

Since you know the image id from your script, you can call the image by image id. As in the code below: var dataset = ee.Image('LANDFIRE/Fire/MFRI/v1_2_0/CONUS');


2

The libtiff and GDAL configs within Google have DEFLATE and LZW. As of November 2021, LERC, WEBP, and ZSTD are not enabled. You can do something like this for compression: -co COMPRESS=DEFLATE -co ZLEVEL=9 You can also specify a PREDICTOR, which may help. See here for more details on setting the PREDICTOR: https://gdal.org/drivers/raster/gtiff.html


1

Satellite imagery come from different sensors. Some imagery is available in Earth Engine catalog and it is free. Some you may need to purchase yourself and upload to your private assets. To your question - this is an example of one image from Sentinel-2 over your area: var point = ee.Geometry.Point([-86.586623, 34.732530]) var s2 = s2all.filterBounds(point) ...


0

The size of an image that you are trying to export is around 16Gb. You can try to check if there is enough space in your Google drive?


1

After you filter your image collection, you take only a first image .first() - it's an image. You cannot apply .filter() to an image, but only to a collection. Also, if you take only a first image, in some cases you may end up with an image that is not covering your region of interest completely. Overall, it's difficult to guess, what the sequence of steps ...


1

You can merge geometries from all features in your feature collection into one multiPolygon and than use a .dissolve() function. var filterAll = ee.Filter.inList('ADM2_NAME', ['Misamis Oriental', 'Davao del Norte', 'Bukidnon']); var all = ee.FeatureCollection(ADM2.filter(filterAll)).geometry().dissolve() Link to the code: https://code.earthengine.google....


1

Maybe something like this? def sample_point(point, image): return image \ .select(['annualNPP']) \ .sample( region=point.geometry(), scale=1000, numPixels=1 ) \ .first() \ .set('year', image.date().get('year')) \ .set('point', point.geometry().coordinates()) def ...


1

The following is the update of your code, resulting in 4 images in each year for every year. // create start index for each season var season_start = ee.List.sequence(0, 9, 3); function ndviForYear(year) { var startDate = ee.Date.fromYMD(year, 1, 1); var make_datelist = function (n) { return startDate.advance(n, "month"); }; // have ...


0

Javascript distinguishs the lower case and the upper case. So, 'solar_azimuth_angle' should be 'SOLAR_AZIMUTH_ANGLE', and 'solar_zenith_angle' should be 'SOLAR_ZENITH_ANGLE'.


1

You might be mixing understanding of server vs client side of scripts. It can seem tricky at first. If-statement is client side, and EE operations are server side. You can read more about this here: https://developers.google.com/earth-engine/guides/client_server If you want necessarily to use if-statement, you can use EE version of it, but I would not ...


0

I am not entirely sure, but I think MODIS AOD is determined by Lookup tables which depend on some physical and observed properties which are generated at a coarser scale than the AOD scale. I think the tiling for these properties is 1 by 1 degrees. Thus the lookup tables systematically vary from tile to tile depending on those differences in physical ...


1

The trick is to save what the previously selected image was so you can easily set the Image to transparent. For this I use the variable current. Then you can get the newly selected Image from the layer list and set the opacity to 1. var current = 0 // Slider to define which image will be shown. var slider = ui.Slider({ min: 0, max: layerList.length() - ...


0

When you are working with these time series collections, you have to be sure that they are not empty at considered geometry. First of all, I "added" as layer first image of modLSTc without any result. So, afterward, I could add modLSTc mean indicating this Image Collection is not empty. Now, I could corroborate that you didn't extract the "...


0

The lossyear band is a number between 1 and 20 indicating in what year the treecover loss was detected. You should multiply a binary mask of loss by .pixelArea(), not a year of loss. Even though you are not using that further in your script, it just important to mention. If you want to calculate loss per year, this can be a useful starting point: https://...


3

If the range you're trying to set is contiguous, then you can just use List.splice(). Your code doesn't work as you're hoping because mapping over list2 is just going to return another list the size of list2. It doesn't (and cant) actually modify list1. If you really have a list of random indexes that you want to replace, you need to map over a sequence ...


2

I don't know which is your final goal but, your affirmation of ee.List.set() only accepts integers as inputs and not lists is not true because you inverted arguments in 'set' method. Following code works without any error. var n = 5; // is arbitrary var list1 = ee.List.repeat(0, n); var list2 = ee.List([1, 3]); // the length of this list is variable (length ...


0

The error already hints at your problem. You are applying a intersect function that requires 2 inputs of type geometry. My guess is that the following line should be changed: Polygon.intersection(water_mask_before,NDTIcomposite, null, null); water_mask_before is a function and not a geometry so you probably want to get the geometry of what the ...


1

ui.Chart.image.regions orders X-axis alphabetically. One possible solution is to add a space before all one digits bands (see here https://code.earthengine.google.com/2a29344cabef33f10d4fb51bd2d9b1c5) Another way is to construct an input for ui.Chart() yourself. Not easy, because .getDataTable() is not working properly. But if it would, you could tweak all ...


1

By now it is possible to do that, but do be careful that geometries with many vertices will crash your browser. Unless it is very simple manipulation you should definitely do your editing beforehand in another GIS program. function setGeom(geometry){ Map.drawingTools().addLayer([geometry]) } var table = ee.FeatureCollection("YOUR/IMPORT/HERE"); ...


0

your dataset is empty so there are no acquisitions of Landsat 4 of the specified region and time period available in the collection..


Top 50 recent answers are included