Questions tagged [javascript]

JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

How to avoid using .getInfo() in Google Earth Engine?

Description: The code below contains a function that calculates the least required days for Sentinel 2 image collection to cover at least 99% of a given area of interest (aoi). In other words, ...
0
votes
0answers
7 views

Displaying layers info while hovering over map feature with Mapbox

I took the following code from Mapbox's website, in a tutorial for making an interactive pop. density map of the USA (https://docs.mapbox.com/help/tutorials/choropleth-studio-gl-pt-2/). // change info ...
2
votes
1answer
26 views

Pixel counting and mode for classification refinement in Google Earth Engine

Currently I am trying to refine a Classification for year 2001 based on the class persistence during a 3 year window: maps of 2000, 2001 and 2002. My two rules are: If in the 3 years period there ...
0
votes
0answers
7 views

JavaScript libraries for converting curves to/from EWKT and GeoJSON

Are there any JavaScript libraries that can convert EWKT/WKT curve geometries (as defined by PostGIS) to GeoJSON or similar? That is, libraries that generate a linear approximation of a CIRCULARSTRING ...
1
vote
1answer
17 views

Understanding the Cloud Mask in Google Earth Engine

I would like to understand what the logic of this code is (I know that with this code it is possible to mask the pixels classified as cloud and cloud shadow of Landsat 8 images). I'm still having some ...
0
votes
0answers
46 views

Switch button on leaflet js

I want to make a button that has two events (like a switch). When on (choose location): it's going to show crosshair.png on the center map so people can hover to the right position (already got the ...
0
votes
1answer
36 views
+50

Leaflet - defining layer features for group of layers

I would like to define the specified features for more than 1 layer. I prepared the code like this, but unfortunately it dodn't work. var path = L.layerGroup([ecl, ant, hyb], { style: function (...
1
vote
1answer
19 views

Leaflet - GeoJSON file can't be loaded on the map

I don't know where I make mistake. It's probably silly mistake, but I cannot load my geojson on the map. I tried the Leaflet "getting started" standalone example and it worked. Unfortunately ...
2
votes
1answer
35 views

OpenLayers WMTS function no longer working - No error messages

WMTS layers have been rendering in OpenLayers 6.5.1 flawlessly in from my code for some time now, but it has recently stopped working. I can't actually think of anything that I've recently changed in ...
-1
votes
0answers
23 views

Sort dictionary and extract 5 highest values in Google Earth Engine [closed]

I want to filter this dictionary by its 5 highest values. It is the number of kidnappings tied to a specific actor in Nigeria between 2018 and 2021. I want to return the names of the actors with the ...
0
votes
0answers
13 views

How to get the segment distance of a line that passes through a raster grid cell

I am building an app using Mapbox.js, H3-JS and Chart.js. H3 basically uses hexagons as a raster grid, with each cell having a unique hex_id as a reference index. I have been able to chart the ...
0
votes
1answer
23 views

How to Separate Image Collections in Google Earth Engine?

In the below code, ERA-5 snow data is called and plotted. Based on this, some of the images detected snow cover and some of them no. So I'm going to know that how can I separate snowy and non-snowy ...
0
votes
1answer
18 views

Accessing elements from a list in Google Earth Engine

I am accessing the properties of an image collection in GEE. I have created an image collection and assigned it to the variable "collection". When accessing the date range I used the ...
0
votes
0answers
30 views

Customizing Layer Display in Map based on Nested Criteria selection with dropdown field outside the Map

I have about 5 different polygon map layers on a map. Each map layer data is stored as separate JSON file (Eg: continent1.json, continent2.json, ...... continent5.json). Every layer have its own ...
0
votes
1answer
29 views

How to calculate Pixel area of every image in an image collection inside google earth engine and display on console as JSON?

I have an image collection and want to clip every image inside the collection first and then return area of every image on console as a dictionary / JSON object Right now I have written this code ...
0
votes
0answers
25 views

Bilinearly interpolate WMS using leaflet

I have a raster hosted on GeoServer as a WMS that has 10 km resolution and is bilinearly interpolated to look smooth around the edges as such: I am using Leaflet to make a js map with this raster ...
1
vote
0answers
33 views

Problem with transfer web-based layer to QGIS

Following this question; Cannot extract the WMS tiles to arbitrary GIS format I have managed to transfer one of the infrastructure blocks to QGIS, because the website has an option to export it as the ...
1
vote
1answer
17 views

How to highlight multiple polygons at once based on feature properties value

I am trying to figure out how to highlight multiple polygons/features based on the feature.properties.NAME value. My polygons are a bit broken up so they are separate features and using an ...
1
vote
1answer
32 views

Coordinate Value not displaying after clicking on Map

I am trying to create a pop-up using Open Layers which will show the coordinate values when I click on the Map. There are no errors in the console window however, whenever I click on Map it displays : ...
0
votes
0answers
22 views

Integrating QGIS2web HTML / JS into Jekyll page

I am using QGIS2web to generate zoomable maps for web deployment. In a student project, we would like to integrate the QGIS2web map into a Jekyll website fed from a GITLAB repo. I can integrate the ...
1
vote
0answers
29 views

Appending ID column back into sampled image

With a lot of help I recently figured out how to extract NDVI values for a specific date for a collection of GPS points (Extracting NDVI value for GPS points - how can I extract NDVI value for ...
1
vote
2answers
36 views

Extracting NDVI value for GPS points - how can I extract NDVI value for specific date and time for each GPS point?

I am quite new to GEE and trying to extract the NDVI value for a set of GPS points (X, Y, and date). I have constructed my NDVI layer and am able to obtain NDVI values for my points, however the date ...
2
votes
1answer
55 views

Finding all unique values in categorical image

I'm using GEE and I would like to guess all the unique value of a raster on a specific region. My rater is uploaded to EarthEngine as an Image and I would like to test only the first band. Which ...
0
votes
1answer
33 views

GEE Converting Units of the FLDAS Precipitation data (Rainf_f_tavg) from kg m-2 s-1 to mm/month

Using Google Earth Engine to extract FLDAS dataset for specific coordinates for the time period 1990-2020. I use Rainf_f_tavg Precipitation bands with the default format is kg m-2 s-1. Then i multiply ...
1
vote
1answer
40 views

Google Earth Engine-function (image) condition

Is there a way to set a condition inside function(image) in GEE? In my case, I am trying to return images with NDVI<0.2 only and use them in qualityMosaic function to generate a composite (with ...
0
votes
1answer
26 views

Adding data-driven elevation to Mapbox GL JS fill-extrusion-height

I can't quite figure out how to extract elevation data from a geojson to use with Mapbox fill-extrusion-height. The geojson looks like this but obviously with a lot more waypoints: { "type&...
1
vote
1answer
33 views

Drawing a segment of azimuth from values defined in Leaflet

Following the query: QGIS drawing segment of azimuth from values defined I would like to do something similar in Leaflet. Unfortunately, I cannot use the QGIS2Web plugin for this purpose, because I ...
1
vote
0answers
37 views

How to intersect two images (Sentinel 2) from each other using Google Earth Engine

It is throwing me an error (ndti_Before.intersection is not a function). how could I solve or fix my code to get an intersected image?I'm trying to get an intersected image. for reference use the ...
0
votes
1answer
21 views

Change GLDAS Pixel Size in Google Earth Engine?

As everyone knows GLDAS data in Google Earth Engine has 25 kilometers spatial resolution. Accordingly I called these data in code editor in order to change the pixel size from 25000m to 250m. I tested ...
0
votes
1answer
29 views

How to reclassify and sum values after calculating monthly MODIS averages in Google Earth Engine

I am trying to calculate monthly average vegetation condition index (VCI) for Ukraine from a MODIS image collection. I then want to reclassify the values to: 1 for values between 0 and 0.4 0 for ...
-1
votes
1answer
41 views

How do you convert WGS84 GPS coordinates to “SWEREF 99 TM” ones in JavaScript + Leaflet.js + proj4 + proj4leaflet? [closed]

I have made a map system with JavaScript + Leaflet.js + proj4 + proj4leaflet. I'm trying to link to Lantmäteriet's map with the current position, but, of course, they don't use the "WGS84" ...
0
votes
1answer
38 views

Google Earth Engine .Mosaic() changing image scale

I am trying to filter an image collection to one date (2015) and create one image (the collection is made up of multiple tiles). Filtering by date and by bounds is fine, and I have been using .Mosaic()...
1
vote
0answers
26 views

Cannot upload created shapefile

I cannot upload my Africa shapefiles that I created in QGIS (where I dissolved all internal boundaries), why? I get this error when I run my code with some Africa shapefiles (which are not dissolved) &...
1
vote
1answer
37 views

Problem of marker click with Leaflet

I am new using Leaflet with R studio and I have a problem ou both Leaflet markers and map_marker click . The first problem is that , when I put addCircleMarkers in the observer in doesn't work while ...
1
vote
0answers
34 views

Remove M value & Z value from shapefile JavaScript [closed]

Is there a way to remove the m value and the z value from a shapefile using JavaScript "leafletjs & shpjs”?
1
vote
1answer
73 views

Google Earth Engine asset quota

I am trying to upload 317 images to GEE to create an image collection to analyze its time series. After about 250 it stopped ingesting and I received the error message: "Error: Exceeded quota ...
1
vote
1answer
30 views

Extract 3 hourly GLDAS data at particular point of time on daily time step from Google Earth Engine

The GLDAS data is at 3 hourly timesteps starting from 3, 6, 9, 12, 15, 18, 21, and 24 UTC. and I want to extract the time series of Downward short-wave radiation flux at 12 UTC only for each day as it ...
1
vote
1answer
47 views

OpenLayers: Fallback tiles on error (“errorTileUrlFunction”)

I've got an Openlayers map with a custom tileUrlFunction loading tiles from a custom tile server. Sometimes it can happen that the tileUrlFunction returns an adress that, deliberately, does not ...
1
vote
0answers
42 views

Leaflet Choropleth Map Highlight Stay

I currently have a leaflet choropleth of the contiguous 48 states that when you hover over a state a popup on the right side of the site this is done using "cards" (https://www.w3schools.com/...
2
votes
1answer
53 views

Getting Image ID in Google Earth Engine?

In the below code I'm going to get image id in a function but returns error. Could anyone guide me please? How can I solve this? code link: https://code.earthengine.google.com/...
0
votes
1answer
58 views

Loading GeoJSON data into Leaflet map using getJSON problem

I've a problem loading GeoJSON data into Leaflet map using getJSON. None of the GeoJSON data is displaying. The basemap & two circles are showing so it looks like Leaflet is working as expected. ...
2
votes
1answer
50 views

ImageStatic in OpenLayers 6 does not fit a given extent when shown on the map

I am using ImageStatic in OpenLayers to display an image on the map using EPSG:3857. I noticed the image pixels were stretched in some cases and were overlapping the specified image extent by 1px ...
-1
votes
1answer
49 views

Leaftletjs load XML and GeoJSON

I found below piece of code which loads GeoJSON from USGS then shows circle and set radius. This works fine when tested. (function () { var FEED1 = 'http://earthquake.usgs.gov/earthquakes/feed/...
5
votes
1answer
164 views

Controlling class label and color from classified image in GEE column chart?

I am trying to create a column chart from a land use/land cover (lulc) classified image (more specifically, the amount of area per lulc class). I was able to create the chart but couldn't set the ...
2
votes
1answer
30 views

Avoid popups outside map area of GeoServer Layer using Openlayers

I have added the function to show a custom message for the feature where data is not available in WMS layer of GeoServer, and it is working but is there any way by which popup does not open outside ...
2
votes
1answer
29 views

GEE: projection error when exporting data to a table

I am trying to export some vegetation condition index data calculated from MODIS data on Google Earth Engine to a table, but keep getting the error: Error in map(ID=3): Image.reduceRegions: Unable to ...
1
vote
1answer
40 views

Classifcation Time Series Error in Google Earth Engine?

In the below code I was going to do classification process for time series data but in training data collection returned this error: code link: https://code.earthengine.google.com/...
1
vote
0answers
11 views

Getting Uncaught SyntaxError: Unexpected token { error when using downloaded ArcGIS API in PC without internet)

I am trying to implement ArcGIS API offline. I have downloaded the zip file from the site and followed the following changes, changed the baseUrl to my Apache IP copied the files to /var/www/html/ and ...
0
votes
0answers
31 views

Convert an imported vector FeatureCollection to raster image with correct longitudes and latitudes and a pixel scale of 30m

I have successfully imported a CSV file detailing pixel land surface temperature (LST) difference, longitude and latitude into GEE as a FeatureCollection. Please see: https://code.earthengine.google....
1
vote
1answer
49 views

OpenLayers dynamic JSON Vector Source works in OL v3 but not OL v6

I'm using OpenLayers display a map which can include vector layers with dynamic features (ie, the lines/points change frequently). These vector layers use GeoJSON in a vector source and use ...

1
2 3 4 5
64