New answers tagged

0

You can fix the scale to 30 by using .reproject() // Get CRS print('Projection: ', ee.ImageCollection("NASA/MEASURES/GFCC/TC/v3").first().projection()) // Reproject var statScaleMosaicreproject = mosaicked.reproject('EPSG:32623', null, 30) print('Scale in meters after mosaicked after reprojection: ',statScaleMosaicreproject....


0

You've reached the total size quota limit for your account. Accounts are limited to 250 GB of space and 10,000 assets. You can check on account limits and status from the Asset Manager tab in the Code Editor—see the second paragraph of the Developer Guide's page on Managing Assets. An alternative option that provides more space for images is Google Cloud ...


1

The click_marker problem is resolved . I wrote map_marker_click while the nale of my map is "mapDepartement" . We must put "nameOfMap_marker_click" to get the right id . But the problem of addMarkers that don't work if I put it in the observer is still there.


0

Sorry, I made a silly mistake, the file Leaflet.Coordinates.css was corrupted. Now it's working like a charm.


1

Actually, for your dates range, you have 112 images in your Image Collection (one image each 3 hours or 8 images per day). As you need for each day noon image only, you can filter your dataset with following method: .filterMetadata('start_hour', 'equals', 12) Code snippet would look as follows: var dataset = ee.ImageCollection('NASA/GLDAS/V021/NOAH/G025/T3H'...


3

An xhr based tileLoadFunction will give you access to the error code. You can then set the src to the objectUrl created from a successfully xhr (object urls should be revoked after use to release the memory) or an appropriate error tile, for example tileLoadFunction: function(tile, src) { var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr....


0

Thanks to @Mike I was able to work around the problem. The problem arises when OpenLayers 6 uses a ceiling function to determine the target width to display the image. I ended up subtracting half of resolution(in meters) from the original extents most eastern point when passing it to ImageStatic. extent[2] = extent[2] - metersPerPixel/2 I found this, at ...


1

As @HMSP pointed out, after using mean() at the beginning of the code, you lost the ID because you are converting the collection into a mean composite without any id. Following code produces normalized images (by using your normalization formula) with its respective id for each image in Image Collection. Map.centerObject(table, 11); Map.addLayer(table); var ...


3

Chart.image.byClass is just calling a grouped reduceRegion. Probably easiest to just build your own data table, so you can then configure the rest of the charting any way you want. var palette = ee.List(["#006400","#00ff00","#687537","#935132","#45c2a5","#b8af4f","#f1c232","#ffd966&...


1

Your GeoJSON loads just fine for me. Are you making sure to load your script through a server (e.g. using Python http.server)? Could be a CORS issue if you're trying to load the GeoJSON locally.


0

Try this: map.fire('click', { latLng: coords, point: map.project(coords), originalEvent: {} }) From: https://github.com/mapbox/mapbox-gl-js/issues/5060


2

A working solution using an adapted version of https://github.com/usgs/quakeml-parser-js to deal with the XML (issues with parsing and unwanted "require") I've also use fetch instead of the old xhr/XMLHttpRequest approach (cf https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) <!DOCTYPE HTML> <html lang="en"&...


0

A click event on the map should not happen if the pointer is not on the map viewport. You could stop the popup working if it is not in a region covered by the WMS: map.on('click',function(evt){ var hit = map.forEachLayerAtPixel(evt.pixel, function () { return true; }); if (hit) { old.check = true; old.resolution = map.getView()....


1

You get this because you do client-side concatenation on acc_val, which is a server-side object. Read Client vs. Server in the Earth Engine docs for an explanation. You can convert acc_val to a client-side object with evaluate(): var acc_val = ee.String(trainAccuracy.accuracy()) // Server-side object acc_val.evaluate(function(value) { // Turn acc_val into ...


0

google.maps.event.addListener(gmap, 'zoom_changed', function() { var zoomLevel = gmap.getZoom(); var sizeGrid = markerCluster.getGridSize(); if (zoomLevel > 22) { markerCluster.setGridSize(0); } else if (zoomLevel > 21) { markerCluster.setGridSize(10); } else if(...


0

First load your shapefile in asset tab then: var table = ee.FeatureCollection("users/my_user/my_shapefile"); var Temp1 = ee.ImageCollection ('COPERNICUS/S2') .filterDate ('2017-01-01' ,'2017-12-30') .filterMetadata ('CLOUDY_PIXEL_PERCENTAGE', 'Less_Than', 20); var Temp1b = Temp1.reduce(ee.Reducer.median()); // until this line is an example ...


0

Some of your inputs don't exist on all days. (Specifically, there is no LST on day 42 and others). You can't train a classifier with missing points in your data, so the classifiers for those days fail. print(ee.Image(datasetMap.toList(1, 42).get(0)) .reduceRegion(ee.Reducer.count(), table.geometry())) That said, Creating a new classifier for each day ...


0

As it turns out, the problem code was not initially included in the original question. Now that I've figured out where the problem really was, I've updated the OP to include all relevant code. One of the reasons that it was not included was that I was trying to post the smallest version of the code that would reproduce the problem. However, in this case ...


1

All Earth Engine functions (except those in ee.data and a few other special cases which actually make API calls or manipulate UI elements) return new values; they do not modify the object they're called on. classified.add(ee.Image(0)); constructs a list one element bigger, and then immediately throws it away since you didn't assign it to anything. Instead, ...


0

Figured this out with help from elsewhere: put the on(someNode, "click", someFunction) to postCreate() instead of onOpen() so that no new event listener is added everytime widget if opened.


0

.toInt16() does not automatically scale the data to fit, so your values are being rounded to integers. You have to scale the data to suit your needs. For example, it looks like 0 to 3 is a typical range of your data. So, you can write .multiply(32767 / 3).toInt16() to get a reasonable result. (32767 is the highest possible value of a 16-bit signed integer.) ...


2

A working solution by adding an EventListener on your checkbox and then play on mapbox source data by reassigning GeoJSON content <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Display a map on a webpage</title> <meta name="viewport" content="initial-scale=1,maximum-scale=1,...


0

You can achieve that by doing: 1.- Get bounds with given center coordinates and radius: let radiusMts = 5500; let bounds = L.latLng(44.6730555555556, 6.9225).toBounds(radiusMts); 2.- Add bounds to reactangle: L.rectangle(bounds).addTo(map); Aditionally you can set a color to the rectangle: L.rectangle(bounds, {color: "#ff7800", weight: 1}).addTo(...


0

Mike in the comments came up with an elegant solution that I ended up using. Simply use .getView().fit() with an OpenLayers Point and set a maxZoom in the options, like so. let point = new Point(coords); olMap.getView().fit(point, { padding: [100, 100, 100, leftPadding], maxZoom:result.zoom, duration:animationSpeed }); Which works perfectly ...


Top 50 recent answers are included