Hot answers tagged

38 votes
Accepted

Does QGIS have the equivalent of ArcGIS's Layer (*.LYR) file?

It does now :) Only in the dev version but something like this could be added in an older release using a plugin. If I get some time I might just do that. A QGIS Layer Definition file will have ...
user avatar
  • 33.8k
38 votes

Fixing polygon self-intersection in QGIS?

When I get errors like this I usually find applying a zero distance buffer can fix the geometries. So use the buffer tool in QGIS and set the buffer distance to 0 units. Then try and use this buffered ...
user avatar
  • 2,056
32 votes
Accepted

QGIS Filtering Multiple Values using Query Builder

One method is to use the IN function followed by your list of values all inside brackets. E.g. "Column_Name" IN ('Value_1', 'Value_2', 'Value_N') Hope this helps!
user avatar
  • 72.2k
24 votes
Accepted

How to change the type of a column of an attribute table in QGIS?

Use Refactor Field in the Processing Toolbox. Go to Processing > Toolbox > QGIS geoalgorithms > Vector table tools > Refactor fields This will open the Refactor fields window where you can select ...
user avatar
  • 3,412
24 votes
Accepted

Creating a temporay layer out of a selection in QGIS

I think there's atleast two methods: Select your features and run the Save selected features tool from the Processing Toolbox. As described in this answer to a related question: Select your ...
user avatar
  • 72.2k
23 votes

Fixing geometry validity errors in QGIS 2

Try running a subtle buffer on the polygons. A setting of -0.001 if your CRS is UTM would seem worth a try. VECTOR|BUFFER
user avatar
  • 510
23 votes
Accepted

Missing processing menu in QGIS

The Processing menu is tied to the Processing plugin. So please check if you have deactivated the Processing plugin in the Plugin Manager.
user avatar
  • 81.9k
23 votes
Accepted

Styling border to match fill in QGIS?

I'm not sure how to enforce it for existing polygons, but you could make it work for any future ones that you create. In Project Properties>Default styles>Style Manager, you could create your own ...
user avatar
  • 546
20 votes

Resizing the map item in QGIS print composer without changing scale?

Update 27/07/2018: As of QGIS 3.2.1, my workaround below no longer works! If I find an alternative solution I will post here again. This is very, very annoying... There is a way to do this. In the ...
user avatar
  • 201
20 votes

Fixing geometry validity errors in QGIS 2

When I have a layer with errors , I normally run it through the GRASS function v.clean in the Processing Toolbox. Though I never really figured out which tool is best in which case, I normally choose ...
user avatar
  • 3,064
20 votes
Accepted

Completely uninstalling and removing QGIS 2.8.1 on Windows Vista

You can make sure all folders in your hard drive and your .qgis2 folder (C:/Users/You/.qgis2) are deleted. You could also delete the Registry entries for QGIS by running the regedit program and ...
user avatar
  • 72.2k
20 votes
Accepted

Representing uneven tree canopy spread around point in QGIS

I have exactly the same use case at work, so this is what I have come up with: Solution 1 (ellipse) This looks fairly regular, but is the least precise generally, IMO. Use the ellipse marker symbology ...
user avatar
  • 7,329
19 votes

Loading OpenStreetMap data in QGIS?

I found downloading OSM data using the plugin and going through the import and export motions very tedious. That's why I wrote up a different solution: http://anitagraser.com/2014/05/31/a-guide-to-...
user avatar
  • 81.9k
18 votes
Accepted

What happened to QGIS 2.x LTR?

It's not temporary. I know that people hate change, but that's the way it is. QGIS 3.4.5 replaced 2.18 as a LTR. You can find older versions here: http://download.osgeo.org/qgis/
user avatar
17 votes

Is it possible to rotate the canvas in QGIS

In QGIS at bottom right corner, there is an option called 'Rotation'. There you can rotate your canvas (or extent of view) by any angle.
user avatar
  • 171
16 votes
Accepted

Can PostGIS and QGIS provide dependable multi-user editing?

Since you're not worried about simultaneous edits on features, I'd say that in theory you have nothing to worry about. The main danger w/ QGIS is that simultaneous editors can stomp on each other's ...
user avatar
  • 19.3k
16 votes
Accepted

Activating layer by its name in PyQGIS

TL;DR To get all features of a layer by the layer name you do not need to activate it. Just use name = 'counties' layer = QgsProject.instance().mapLayersByName( name )[0] poles = layer.getFeatures() ...
user avatar
15 votes

Zooming to layer extent in PyQGIS?

Something like below should work. vLayer = iface.activeLayer() canvas = iface.mapCanvas() extent = vLayer.extent() canvas.setExtent(extent)
user avatar
  • 6,974
14 votes

How to put North Arrow and Scale on map in COMPOSER in QGIS 2.2.0

The north arrow is added as an image. The behaviour of the scale depends on the CRS of your data/map. Once you start inserting an image in the composer, you should get the option to select from a ...
user avatar
  • 3,422
14 votes

Georeferencing window won't open QGIS 2.4

I had the same problem. This should solve the bug (QGIS 2.6 under Windows): close QGIS using regedit.exe, search for "Plugin-GeoReferencer". This should point to a folder under \HKEY_CURRENT_USER\...
user avatar
  • 271
14 votes
Accepted

How to generate multiple maps where one highlighted attribute changes?

What you want is creating the Atlas. In print composer, go to Atas generation tab and check Generate atlas. As covarage layer set your counties layer, and as output set your name of counties ...
user avatar
  • 6,437
13 votes

How to format labels with leading zeroes?

Working on QGIS 2.18.20 I see a different behavior of the one described by @NathanW: lpad("id",2,'0')-> '02' rpad("id",2,'0')-> '20' Where I think r stands for right and l ...
user avatar
  • 3,089
13 votes
Accepted

User Interface file compilation using OSGeo4W shell during qgis plugin creation

I will write a quick explanation of the pyuic4 and pyrcc4 commands for future reference. Most tutorials simply tell you to copy some code, but no one explains exactly what you are about to do. It is ...
user avatar
  • 6,209
12 votes
Accepted

Using qgis:selectbylocation in PyQGIS

I used this code: mapcanvas = iface.mapCanvas() layers = mapcanvas.layers() processing.runalg('qgis:selectbylocation', layers[0], layers[1], u'within', 0) with this situation: and it worked: ...
user avatar
  • 25.9k
12 votes
Accepted

How to work on downloaded copies of database tables in QGIS

QGIS comes with "offline editing" functionality in core. This downloads the data to a local spatialite database, so you can work on an offline copy and the delay caused by network roundtrips is gone. ...
user avatar
12 votes
Accepted

Easy way to create buffer in QGIS 2?

In the 2.18.11 QGIS version there is a easy way to calculate buffers. This option is in build in the MMQGIS plugin . Once you have the QGIS plugin you have the option to create buffer When you ...
user avatar
  • 2,727
11 votes

Fixing geometry validity errors in QGIS 2

You can use ST_MakeValid directly in QGIS adding lwgeom plugin that add lwgeom provider to processing toolbox => you can apply MakeValid directly on your loaded layer without converting in postigs/...
user avatar
11 votes

Creating DEM from Point Data using QGIS?

A DEM (digital elevation model) is a raster and not contour lines or polylines. If the point data is a systematic grid of points (equal spacing) then it is as simple as converting straight to raster ...
user avatar
10 votes
Accepted

How to change attributes with QGIS Python?

You are right, that you don't need to call commit if you work on the dataProvider directly. However, this will also commit every update immediately, leading to more I/O overhead (often decreased ...
user avatar
10 votes
Accepted

Creating several maps showing different layers but same area using QGIS?

In QGIS 2.8 you have the option to lock the styles in a map. First add number of map pages in the print composer. Example with two maps: And the corresponding print composer In the Print Composer ...
user avatar
  • 7,291

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