New answers tagged

0

You need to multiply by 0.0001. var byMonth = ee.ImageCollection.fromImages( months.map(function(m) { return modis.filter(ee.Filter.calendarRange(m, m, 'month')) .filterBounds(COAHUILA) .select('NDVI').mean().multiply(0.0001) .set('month', m); }));


0

The csv sample would be very helpful. IMO your problem is in passing latlong values. Docs says that coordinates shout be passed in Array. I'm not sure what L.latLng passes, try console.log it and if it's array, so I'm wrong and curious what's the problem. You could also try put it some sandbox like eg.: https://jsfiddle.net/


0

The solution for the above question asked by me in 2016 was found in the extension of Openlayers given at the link. We need to include ol-ext.js and ol-ext.css along with the openlayers library and jQuery.


2

You could use a javascript array map to extract the id and properties collection from the features in a json console.log(JSON.parse(values).features.map(function(value){ return { id: value.id, properties: value.properties }; }));


1

myEntity.polygon.hierarchy.valueOf(); See this example: https://sandcastle.cesium.com/index.html#c=rVVNb+IwEP0rFheCBA6IdiFtirZl91apK+22l4aDSYbEWsdmbSeIVvz3HTBU4asFCR8Qnnlvvjx6KZkmJYcZaHJHJMzIEAwvcvqysnn1eHUdKmkZl6DrjdtIRrJE1lgU8EuJeaokUl0MCtJyy8FQliTeeyQJHslyIDek/oAEMl0zZtxmJFMCTL3pYBvPDVnzlifjoJmOs/m22eENplLSoGtd9JBpi/+Y7NKJVvkPSDWAudeazb3XVhDQdpN02/...


1

You have to define sum variable outside feature processing function as global variable. Then you have to wait for feature layer load event before you can use/display sum. Code could then look something like this: var sum = 0; var casese = L.esri.featureLayer({ url: casesURL, onEachFeature: function (feature, layer) { sum += feature.properties....


0

The main problem I ran into was that I am trying to enhance a very old version of WAB, version 1.2 (I think the current version is 2.4 or something) which cannot use the same methods, such as .triggerWidgetOpen. Of course, there was little documentation on how to practically achieve this in the esri documentation, but here is the solution that was pointed ...


2

It looks like Leaflet is not entirely happy with layer removal inside layer event. You can remedy this by putting layer removal in setTimeout event processing function with slight delay: map.on('layeradd', function (event) { if (event.layer == layer1) { $('#layer1')[0].textContent = 'MyLayer' $('#legend-layer1')[0].setAttribute('style', '...


2

You can calculate gamma0 like this: function toGamma0(image) { var gamma0 = image.expression('i - 10 * log10(cos(angle * pi / 180))', { i: image.select(['VV', 'VH']), angle: image.select('angle'), pi: Math.PI }) return image.addBands(gamma0, null, true) } https://code.earthengine.google.com/33e9cffee06f27b92b86e15b713a17cc


0

You didn't provided a complete, working example. I will assume you've got your classification working and your areas are correct. The percentage you simply calculate like this: var barelandArea = ee.Number(3) var totalArea = ee.Number(10) var barelandPercent = barelandArea .divide(totalArea) .multiply(100) print('bareland %', barelandPercent)


2

You can simply wrap the code you have into a function and map over your image collection, invoking the function for each image. var correctedCollection = collection.map(minnaert) function minnaert(img) { // The minnaert code, returning the resulting image } Here's a concrete example showing the yearly median corrected and uncorrected. (I tried to use it ...


2

You have removed the casting to ee.Image in the If() statement. Adding it back get this to work again. var out_c = ee.Algorithms.If( out_a, ee.Image(ee.Number(out.get('scale'))), ee.Image() // Masked image )


2

I believe all the reduceRegion() calls are simply too much for EE to handle in one go. If you increase the scale, it works better. What scale you need in order to get good results is a different question. There's a second problem with your code. Some images are more or less completely masked out. That causes out_a and out_b to be null, giving error when ...


2

Upon clicking L.control.locate button, circle marker is drawn at the current location when location is found. One possible approach to save location to file is that upon clicking on this marker, it's location is saved (downloaded) as text file. But to catch marker click event, marker instance is needed. It's available only as internal _marker property of ...


3

You need the bearing, which is the angle from point 1 point 2 on the surface of the globe. You can get that from turf.js, a powerful GIS calculation library. Then you need a distance formula, to get the distance on the surface of the globe between the two points. Again, turf.js has a distance function. Once you have the bearing and the distance, you've ...


4

Solution below is based on using HTML canvas elements and operations upon them to clip heatmap layer with desired polygon. It's more proof of a concept than full fledged solution. But it works. The following elements are used in the process of creating clipped heatmap: heatmapLayer layer is created, with full unclipped heatmap. HTML canvas element ...


0

Easily done. Add this to the bottom of your script. This checks every pixel, and if it equals 9, then it passes the test the new pixel is set to 1. otherwise, 0. var subset = result.select("cluster").eq(9).selfMask(); Map.addLayer(subset,{},"only 9"); ==== Edit === .selfMask() will hide all the pixels that don't match the criteria.


2

Considering that heatmap.js does not output the heatmap as geojson but just json and clip it to a bounding box rectangle, it is difficult to clip it in the way you want it. It is better to create a heatmap raster using a QGIS's Heatmap tool that you can find under Processing menu > Toolbox Toolbox > Interpolation. If you want to automate it, you can use ...


2

You should be able to do that by iterating the map layers: myApp.mapview.map.layers.items.forEach(item => { item.visible = false; });


2

Something like the below? You need to decide how to combine multiple days of images into one, here I took the median value. You also have some 3-day intervals without any imagery that you need to filter out. This code relies on that median() returns a 0-band image when there are no images in the collection. var table = ee.Geometry(Map.getBounds(true)) var ...


0

I had a similar problem and came up with a work around in 2 steps: Use the buffer function to draw a circle around your point. Use the bounds function to fit a bounding box around the circle. Maybe not that elegant, but it does the job: var pointList = [ ee.Feature(ee.Geometry.Point(-73.96, 40.781)), ee.Feature(ee.Geometry.Point(6.4806, 50.8012)) ]; ...


0

Classification over Image Collections require usage of the map function. See the small example in the link how I managed to do it. Firstly you have to create a function which does training and classification. function classification(image){ var training = image.select(bands).sampleRegions({ collection: points, properties: [label], scale: 30 }); ...


3

This will be an attempt to guess of how you would want your chart to look like. Option labels gives label to each of your data on x axis, option label names your data set (displayed above chart), option data within datasets option sets your data values. Option scales set the range of data values on y axis. So you Chart definition could look something like: ...


1

You can use the ui.Map.DrawingTools module to do this. Convert the ee.FeatureCollection to an ee.Geometry. Transfer the resulting geometry to the client using evaluate(). Add client-side geometry as a new layer of the drawing tools. Note: when you convert the feature collection to a geometry, all properties of the features are lost, which limits the ...


1

Unfortunately, CARTO.js does not support feature over multiple layers. I have replicated your problem in this glitch example. CARTO VL, on the other hand, supports this type of interactivity. You can see a working example here. You can open a bug ticket in CARTO.js v4 github repository, but that project has not being updated for a while.


0

I managed to solve this by adding the: this.viewer.scene.requestRender(); right after this.dataSources.show = visibility; so the final solution is: this.visibilitySubscription = this.store.visibility.subscribe(visibility=>{ this.dataSources.show = visibility; this.viewer.scene.requestRender(); });


Top 50 recent answers are included