A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged

10

In the Layer pannel, there is an icon in form of an eye : Manage Map Themes (documentation) : By clicking on it, you can see the option for display / mask the selected layers. You can also go to the Settings menu > Shortcuts, find these options (one for display selected, one for mask selected) and affect the shortcut you want. PyQGIS code : Copy and ...


8

It can be done in Field Calculator with function aggregate(). In point layer create new field with field calculator expression like this: aggregate( layer:= 'polygon_layer_name', aggregate:='concatenate', expression:=joining_field_name, concatenator:=', ', filter:=intersects($geometry, geometry(@parent)) ) Where layer is polygon layer name written like ...


8

If you want to create a new group, click on the paper clip icon and create a sub-group, then drag it out of the original group to become a separate group and not sub-group. See the image below. Finally, select the layers you want from group 1 to the new group. If you want to split them and put them just as separate layers, then do not create a group and ...


7

Duplicating the layer in QGIS Canvas does not mean creating a new shapefile in your hard disk (HDD), you are still referencing to the same shapefile in your HDD. To create a new shapefile you need to right-click -> Export -> Save feature as and create a new shapefile. Before exporting to a new shapefile, you can uncheck the fields that you do not ...


6

this is because your street name and address number are label. Label are always rendered last (so on top of all layer) you can't have symbology covering a label. But if you want to choose the label rendering order you may set 'Label z-index' for each layer.


5

One possible issue is that the Layer Order is being set by the Layer Order panel. To check this, open the Layer Order Panel: View> Panels (near the bottom)> Layer Order Panel Then make sure the "Control rendering order is not ticked, and the Layer Order panel is greyed out. Like so:


5

Probably try to rename the file and/or location/path without non-ASCII character, e.g. á, blanks etc. Save your input file direct in C:/ and save your output direct to C:/, if your user name contain a special character, try it with a guest account In my experience non-ASCII characters in file names or user names can cause such errors


5

Yes, it is possible. In QGIS 3.6, right-click the layer that you want keep its style -> Styles -> Copy style -> Select Symbology Then go to other layer select them all using SHIFT and left-click on your mouse, then right-click any place above the selected layer -> Paste Style All of them will have the same style:


5

To fix my issue I edited VectorSplit.py located at QGIS 3.4\apps\qgis-ltr\python\plugins\processing\algs\qgis\apps\qgis-ltr\python\plugins\processing\algs\qgis I reverted the first change here https://github.com/qgis/QGIS/commit/8446d3bdf0089cdee6316e40a7cd0047dbf455c1 such that line 111 now reads fName = u'{0}_{1}.shp'.format(baseName, str(i).strip())


5

It's because your function arguments don't match up with your require modules. These must be in the same order! require([ "esri/Map", "esri/views/MapView", "esri/layers/TileLayer", "esri/layers/FeatureLayer", "esri/graphic", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "dojo/domReady!" ], function (Map, MapView, TileLayer, FeatureLayer, Graphic,...


5

Queries shall do the work but they can probably be optimised, e.g. proceeding with a loop. Currently working on those improvements Tested on QGIS 2.18 and QGIS 3.4 I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Option 1. For features in different layers Let's assume we have the following layers "...


5

We could create a new button on the toolbar which lets you choose a style to apply to the selected layer by writing some code into the Python Console. Open the console using Ctrl + Atl + P and then copy/paste the code below: action = QAction(QIcon(""), "Load style for selected layer", iface.mainWindow()) action.setCheckable(False) iface.addToolBarIcon(...


5

No need to use PyQGIS. You can do this with the Field Calculator. Install the RefFunctions Plugin (this gives you access to new functions like geomintersects). Use the Field Calculator to update the field in the point layer using this expression: geomintersects( 'polygons','ID') where 'polygons' is the name of your polygon layer, and 'ID' is the name of ...


4

It is called the layer heading. Go to symbology. Change the value field to something else. Change it back. It should reappear. The proper way is Make sure the layer has headings. ... Double-click the legend to open the Legend Properties dialog box and select the Items tab. Click Style. Click Properties. Select the General tab. Choose a heading from the '...


4

You can create a folder to hold your templates. Create the Shapefiles, style them, set the labels. The, for each of them, save the style/label as a QML file. Right click the layer, go to properties, then style, then hit the style button then save style / QGIS Layer Style File and use the same name as your Shapefile (so mylayer.shp -> mylayer.qml). When you ...


4

The event handler for capturing layers added to the map is IActiveViewEvents.ItemAdded Make sure its pointing to a Map and not PageLayout. You would then test to see if it is specifically a shapefile.


4

If your track points compose the outline of the polygon, it means that they share a spatial relationship. Thus, you could use the Join Attributes by Location tool. Here you specify the type of spatial relationship between the input layer and the join layer. In QGIS3 the tool is located in Vector > Data Management Tools and its interface look like this: ...


4

If you would like to contribute to OpenStreetMap you will need to sign up for an account and then choose an OSM editor. Start with the Beginners' Guide. After that, it's important to read the existing documentation on how to contribute data to the project, especially the OSM tags and mapping techniques.


3

You can try layerList = QgsProject.instance().layerTreeRoot().findLayers() for layer in layerList: print(layer.name()) That will give you a list of layer names Check out the QgsLayerTree class for more info


3

I took for granted that some polygons will overlap separately with several polygons. This makes it so one ID cannot describe all overlaps. A list of overlaps in your original layer's table can work for queries if you have another layer with overlap IDs. I use QGIS 3.4 so if you're using 2.x, it might be different. First, create a field in the attribute ...


3

There is an issue with this line: arcpy.SaveToLayerFile_management(temp_CSlyr, temp_CSlyr, "ABSOLUTE") Since no directory is specified the layer file is created in some unknown location - from all my abilities to discern it's created in memory somewhere. You then try to make a mapping layer by looking in a file geodatabase: addLayer = arcpy.mapping.Layer(...


3

You could use the following to sort all loaded layers alphabetically: from collections import OrderedDict root = QgsProject.instance().layerTreeRoot() LayerNamesEnumDict=lambda listCh:{listCh[q[0]].name()+str(q[0]):q[1] for q in enumerate(listCh)} mLNED = LayerNamesEnumDict(root.children()) mLNEDkeys = OrderedDict(sorted(...


3

The root cause of the problem is corrupt .shx file. Maybe after improper deletion of data from attribute table.


3

I don't believe you can access that text because you are using a Single Symbol. If you read the help file on layer objects in the arcpy mapping module a property of a layer is symbologyType which will return OTHER for single symbol and that is not a supported type. If you were using Unique Value, a supported type, then you would be able to access those text ...


3

Looking at your image you are accessing the geodatabase from within MS Access? That is a real no-no! You can easily (if you have not already done it) corrupt the database. You must only interact with a personal geodatabase from within ArcMap to ensure data integrity. You create personal geodatabases from within Arcmap, you cannot simply convert an existing ...


3

I would go with a QGIS/LibreOffice combo (HT Kazuhito): In QGIS Use the intersection tool to create a new layer, with repeated features. Each time a (point) feature of the Input layer is contained in a (polygon) feature of the Overlay layer, a new (point) feature is created in the Output layer. (Point) features not contained in any (polygon) feature ...


3

You can do this with the join attributes by location (summary) tool. If your polygons are in multiple layers, merge them into a single layer before proceeding. Use the merge vector layers tool or select, copy and paste the polygons into a single layer. I'm assuming that your polygon layer has an attribute table field (eg, "name") which contains the polygon ...


3

These kinds of problems are byproducts of data creation/organisation. If you use data for map creation you will not necessary organise your data/database the same way than for data analysis (and I guess that webmapping may have different requirement than printed map). The way (file format, data organisation...) the data are provided are generally not what ...


3

Here is some boiler plate code to set up active view events. You'll just need to write a function that checks if the item added is a shapefile. Call that function from Events_ItemAdded(). public static IActiveViewEvents_Event ActiveViewEvent; private void WireDocumentEvents() { // Event handlers ArcMap.Events.CloseDocument +=...


3

In QGIS 3, QgsMapLayerRegistry() has been replaced by QgsProject(). You can find more information about backwards compatibility here. To show the feature count of a newly-added layer, you could use something like the following: mem_layer = QgsVectorLayer(uri, 'my_file', 'delimitedtext') QgsProject.instance().addMapLayer(mem_layer) mem_layer.loadNamedStyle(...


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