Hot answers tagged

15

Demo: SOLUTION: This is a two-step solution, Step 1: Browser (JavaScript). It copies the popup text to the clipboard. Step 2: QGIS (Python). It gets the text from the clipboard, parses to obtain latitude and longitude, then adds the point to the active layer. In Browser: Open the website. Open DevTools Ctrl+Shift+C. Source > Snippets > New snippet &...


9

Here my solution, entirely in QGIS (version >= 3.14, for versions >= 3.0 and < 3.14, maybe few adjustments are needed). The solution is to create a points grid in QGIS and retrieve data from JavaScript functions and update each point. The entry parameters of the function are : QGIS interface iface The solar eclipse elements, you can find it in the ...


2

Leaflet (by default) takes the fillColor option given to any instances of L.Path and turns that into a fill attribute of a SVG <path>, as per this fragment of code: if (options.fill) { path.setAttribute('fill', options.fillColor || options.color); path.setAttribute('fill-opacity', options.fillOpacity); path.setAttribute('...


2

I did check the documentation of Arcgis api to export map here (if it can help to find other solution). I have seen you can choose to get different file format including kmz wich would be easily integrated in QGIS. I have modified the f parameter to get kmz and erased the parameter that have no values set to be easier to read (it will act the same, using the ...


2

I'd just leave jQuery's deferreds behind and switch everything to Promises and fetch()es. function getData() { return fetch(myURL, { /* stuff for post */ }) .then(function(response) { return response.json() }) .then(function(json) { dataLayer.addData(json); }) .catch(function(error) { /* handle errors if any */ } } getData().then(nextFunc); ...


1

Your mapfile is mostly OK. I used the states.shp shapefile from the GeoServer demo data in my test and converted it into GeoJSON with ogr2ogr ogr2ogr -f geojson geoJson.json states.shp I checked with ogrinfo that my geoJson.json file contains a layer named "states" and used that in my mapfile. Other edits that I did are edit EXTENT to be worldwide ...


1

I would do it like that : Don't charge the layers in your project. It will save you a lot of time. Use the tool mergevectorlayer to merge all the geojson layer. You can select a folder directly to make this quick. If there is a bug due to the number of layer try to split the work in different folders. Save your result on a layer in shp file or geopackage. (...


1

If you want do display coordinates of the clicked point, you can use layer popupopen event processing function to get hold of clicked coordinate and set popup content accordingly. Code could the look something like this: let testing = L.geoJson(riverdata, { style: lineStyle, onEachFeature: function (feature,layer) { layer.bindPopup(''); layer.on(...


1

after trying with WFS and also clustering my MultiPolygon shapefile, I found the answer to my own questions, and the answer is: the use of VectorTile. After installing Vector Tile Extension successfully in GeoServer, and then setting my Layer following the documented step in here, and then with OpenLayer I use ol.source.VectorTile as the source of my ol....


1

The GDAL library (available in QGIS) can give you a GeoTransform from a file. Apply it to your x,y data. Example below. Update A function in a loop is probably what you are looking for. import shapely.wkt as wkt from shapely import affinity from osgeo import gdal, ogr, osr def transform_string(string,rasterfile): # make the transform parameters and ...


1

Here is how to do it: NOTE: You will need to install conda. What this script does Takes in .zip full of grib2 and loops over them Makes some custom changes to the grib2 as a geopandas dataframe (you will need to customise this to your use case) Outputs in geojson with a .index file to make it easier for your front end to read it in. import xarray as xr ...


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