New answers tagged

0

It's a pity, that in QGIS this is not possible directly. But if you install MapProxy, configure your XYZ-layer and call back the MapProxy layer as WMS source, you can apply the transparency via option image: image: transparent_color: '#ffffff' transparent_color_tolerance: 20 Unfortunately, this workaround is needed because in Mapproxy it's even not ...


0

I also just had this problem, for me, it turned out to be because the CSVs I was generating via HeidiSQL did not have double quote enclosing on the fields.


7

You must first access undo action (mActionUndo), then you can use its triggered event. undo_action = [a for a in iface.digitizeToolBar().actions() if a.objectName() == "mActionUndo"][0] def fun(): print('UNDO') undo_action.triggered.connect(fun)


2

QGIS is able to check if the layer has spatial index or not for several providers, including shapefiles. I've create a new project with two shapefiles. For one, I've created a spatial index. Then I used the GUI and PyQGIS to check if the index is correctly detected and reported. GUI: Check layer properties Layer properties panel will tell if the layer has ...


4

I can't answer your question (the "why") but I can help you solve your problem. It is currently not well documented but you can add another "magic" parameter to your function and that allows access to such information. The Python expression function template says : param context: If there is an argument called ``context`` found at the ...


0

As @Son of a Beach says in the comments the symbology is part of the layer object and not the data. Explore using the tool Apply Symbology From Layer to transfer symbology between layers.


0

You can simply change the order of your layers (variables) in the map script. For example, if you have: var layer1 = L.geoJSON(leyer) //... var layer2 = L.geoJSON(layer) //... var layer3 = L.geoJSON(layer) var overlays = {} and you want to have layer1 on the top, you just need to change their order across your code var layer 2 = L.geoJSON(layer) //....


3

Visible layers You can iterate visible layers in this way: # Iterate visible layers (warning: only spatial ones) def iterate_visible_layers(): for layer in iface.mapCanvas().layers(): # TODO: Do something interesting with the layers print(layer.name()) iterate_visible_layers() Layers in TOC (layers panel / legend / layer tree) In ...


2

You need to store the current zoom level when zoomed to a state using stateZoomLevel = map.getBoundsZoom(e.target.getBounds());. Then you need an event listener on zoomend and check if the stored zoom level is bigger than the current one. If so you need to hide the counties and show the states. Here is a sample using your code. I have used fetch to query the ...


2

QGIS 3.20 The "Identify Features" tool (Ctrl+Shift+I) & right click on the point you want to identify the raster.


0

I solved this problem using this code: var drawingTools = Map.drawingTools(); // Initialize empty geomtry layers as placeholder and fill them with drawn shapes while (drawingTools.layers().length() === 0) { var dummyLayer1 = ui.Map.GeometryLayer({geometries: null, name: 'geometries1', color: 'grey'}); var dummyLayer2 = ui.Map.GeometryLayer({geometries: ...


0

Method in ui.Map.DrawingTools for drawing objects is 'addLayer'; as it can be corroborated in following code. var polygon = ee.Geometry.Polygon( [[[51.50311161691894, 25.26703875176188], [51.50427033121338, 25.26502063795976], [51.50637318308105, 25.266146128641104],]], null, false); var line = ee.Geometry.LineString( [[...


Top 50 recent answers are included