Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
3

The error occurs cause you did not rename the band to 'NDVI' and you did not use the actual variable containing the NDVI band (you are now using the original collection using 'S2collection.map(S2maskedVeg)'. You would (i think) best first define all you functions. Then apply them in the required order to your image collection, so the one where NDVI is ...


3

Since there seems to be no official hook to implement this, one has to resort to hack. L.Draw.Marker class has internal _onClick method which is called when user clicks with mouse to create marker. This method can be replace with our own hacked method by modifying L.Draw.Marker class. We can check here if clicked point is within polygon and allow creation ...


2

If you would copy past the raw data into a ee.Dictionary, this would be possible: var dict = ee.Dictionary(RAWJSONDATA); // inspect the dictionary print(dict) Inspecting your file, you are interested in the 'pings', which have a lon and lat and a date property. You could rewrite them into useful GEE features using: // make features from each element in ...


2

The solution to this was z-index related and after finding a thread on the Leaflet Github I came across that mentioned this but was not in the included options was to do this. Added zIndex: 100, To my WMS tile layer like so... var radar_current = L.tileLayer.wms("http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0q.cgi", { layers: 'nexrad-n0q-...


2

If your data is a string you will need add any extra [] then convert it into an array of coordinates var polyCoords = '[3143090.603086447, 9928281.393790578], [3283734.7351311715, 9928892.890016861], [3181003.3691158947, 9849398.380600277], [3143090.603086447, 9928281.393790578]'; var pointCoords = '[3229617.319105267, 9916160.39109719]'; var ...


2

As noted in the comments the primary issue is the layer needs to be added to the map. Once that is working it's apparent the default center/center anchor setting for icons isn't appropriate for the image being used, it should be [0.5, 1] for center/bottom and for most displays a reduction of scale will be needed. var iconLayer = new ol.layer....


2

If you want to get some information from the tiles to parse to the Export function, you will need getInfo. Alternatively, you could make some "fake" id in the client side (like using i directly). I think you could get rid of 1 getInfo, I've been doing this in the Python API, and haven't test it in JS, so the following code has not been tested, but you can ...


2

If you specify an extent when you create the layer var wmsLayer_Parcel = new ol.layer.Image({ source: new ol.source.ImageWMS({ url: NicURL, params: { 'LAYERS': 'parcel_layer' }, serverType: 'geoserver', // crossOrigin: 'anonymous', }), extent: ???? }); wmsLayer_Parcel.getExtent() will return that when you need to fit the ...


1

It would probably help if you posted a sample of the raw GeoJSON that you are receiving, but I would assume that it looks like a typical geoJSON, like this: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [102.0, 0.5] }, "properties": { "...


1

I'd recommend something like the following: var colors = { orange: '#ffa500', blue: '#0000ff', green: '#008000', pink: '#ffc0cb', }; var markerOptions = { opacity: 1, }; switch(Data[i].value) { case "A": markerOptions.color = colors.orange; break; case "B": ...


1

I guess you are looking for reducing the image collection with percentiles. You could either use the percentiles or use interval mean to get the mean of values in a percentile range. Most of the times, the reducer percentile with percentiles between 20-40 works best, as cloud are in the ~ upper 60-100% and shadows in the lower ~0-10% of the image collection ...


1

Use map.setLayerZoomRange: map.setLayerZoomRange('my-layer', minzoom, maxzoom);


1

Leave the time value in the coordinates, just as you would for GPX: var geojsonObject = { 'type': 'FeatureCollection', 'crs': { 'type': 'name', 'properties': { 'name': 'EPSG:3857' } }, 'features':[ 'type': 'Feature', 'geometry': { 'type': 'MultiPoint', '...


1

Here is the basic idea, set a style for the line, and set a style for the highlight, then in your forEachFeature function, set the layer on click to highlight. My example below resets the style in case, you clicked on one before. var highlight = { 'fillColor': 'yellow', 'weight': 2, 'opacity': 1 }; function forEachFeature(feature, layer) { ...


1

Sounds like you want to read a file and create markers, and these markers should be in a layergroup so Leaflet handles them as one layer. Here is something similar to your code that I used. $.getJSON(url, function(data) { for (i = 0; i < data.length; i++) { var lng = data[i].coordinates[0]; var lat = data[i].coordinates[1]; ...


Only top voted, non community-wiki answers of a minimum length are eligible