Skip to main content
22 votes
Accepted

Unique constraint failed error when saving GeoPackage in QGIS

The short answer: how to solve the problem There are at least three possibilities (screenshot for solution 1 and 2 at the bottom): In the export/save dialog, expand Select fields to export and their ...
Babel's user avatar
  • 71.5k
13 votes
Accepted

Show text inside polygon on Leaflet map

Since you seem to be using leaflet 1.0 you can use the tooltip to attach text to a polygon. No need for a separate label plugin or anything. Just this: polygon.bindTooltip("My polygon", {...
Spacedman's user avatar
  • 64.3k
12 votes
Accepted

Trying to use "Difference" tool gives out "'QgsWKBTypes' is not defined" error

This problem was already fixed in the source code, see the reported issue. You have mainly 3 solutions: Mid term solution According to the road map, QGIS 2.18.1 will be released in 25.11.2016, you'...
Germán Carrillo's user avatar
12 votes
Accepted

QGIS merge layers: error on data type

In QGIS each attribute field has a fixed data type. Common data types are integer number and text but there are more. If field is defined as an integer you cannot store free text strings into it. You ...
user30184's user avatar
  • 66.2k
11 votes

How to reinstall QGIS from scratch on Ubuntu?

sudo software-properties-gtk there in the package manager remove qgis and ubuntugis from the list; sudo apt-get autoremove sudo apt-get autoclean sudo apt-get -f install sudo apt-get autoremove qgis ...
Elio Diaz's user avatar
  • 3,466
11 votes
Accepted

Error of MultiLineString object is not iterable

You need to use geoms method for multipart geometries. mls_list = list(mlines.geoms) print(mls_list) # OUT: # [<LINESTRING (0 0, 0 20)>, <LINESTRING (20 0, 20 20)>]
Kadir Şahbaz's user avatar
10 votes
Accepted

TypeError: QgsVectorLayer(): argument 1 has unexpected type 'QgsVectorLayer'

Try this: a6 = processing.run("native:difference", {'INPUT':'_78b00e45_4a8e_4490_9920_f75f6e055a6a','OVERLAY':'te_afb4845c_d9b4_4498_87b0_9da89a98b2f4','OUTPUT':'TEMPORARY_OUTPUT'}) layer1 = a6['...
Noura's user avatar
  • 3,429
9 votes
Accepted

R will not read shapefile / file.exists returns true

It took me a bit to get this too. # shapefile path example: # C:/Users/User/GIS/MyShapefile.shp # OGR command: library(rgdal) readOGR("C:/Users/User/GIS", "MyShapefile") You have to leave off the "....
JMT2080AD's user avatar
  • 655
9 votes
Accepted

"ImportError: cannot import name uic" error in QGIS

Sometimes it is possible that some files from older installations aren't correctly replaced/deleted when updating to the newest QGIS version and you may get an error like the one that you reported. ...
mgri's user avatar
  • 16.2k
8 votes
Accepted

The following layers were not correctly generated. Grid

Based on the error message and what ended up working, there is likely something wrong with the path that you used to save the file in. Like what worked, you can choose to use the "[Save to temporary ...
HeikkiVesanto's user avatar
8 votes
Accepted

QGIS ImportError: No module named 'PyQt5.QtSvg'

You're missing the python3-pyqt5.qtsvg dependency. Install that and retry.
ndawson's user avatar
  • 27.6k
8 votes
Accepted

Plugin crashes QGIS 2.18 if running simuntaneously with python console

This is indeed an effect of using the print statement and having the python console open. And using the logging module as proposed is a very good approach to solving this issue. Here follow some ...
Matthias Kuhn's user avatar
8 votes
Accepted

ASCII-data source is not supported

Unzip files and then open them in your preferred text editor. Remove all header lines before NCOLS. Then you can plot them on EPSG:31467 projection.
Kazuhito's user avatar
  • 30.8k
8 votes

Error while using sjoin in GeoPandas

Solution: First: sudo apt install libspatialindex-dev Then: sudo pip3 install rtree
datasciencebegginer's user avatar
8 votes

Cannot convert '#value!" to double

There are values in the field that can't be converted to a double (a string with letters, wrong decimal separator etc).
JGH's user avatar
  • 42.1k
8 votes

Cannot convert 'nan' to double error when using QGIS field calculator

The expression returns the error if there were circles or polygons very similar to circles among the polygons; in fact assuming the presence of a circle: (2*pi*r)^2 < 16*pi*r^2 pi(4*pi*r^2) < 4(...
pigreco's user avatar
  • 4,480
7 votes
Accepted

Unable to add shapefile. Receive an "Open Failed - Error Opening Feature Class" when trying to open in ArcMap

Related to my comment, the minimum files to make up a shapefile are the .dbf, .shx, and .shp (.prj is nice to have too). You are missing the glpv1.dbf file.
artwork21's user avatar
  • 35.1k
7 votes
Accepted

Google Earth Engine Update

If you are just using the code editor, you can ignore this. If you are developing applications in Python or JavaScript, using the earthengine-api package, you should make sure you are using v0.1.215 ...
Daniel Wiell's user avatar
  • 14.2k
7 votes

PostgreSQL-12.3 / PostGIS-3.0 - could not access file “$libdir/postgis-2.4”: No such file or directory

Possibly unrelated, but when I ran into the same error message, I was able to fix it by running ALTER EXTENSION postgis UPDATE;
Ariel Allon's user avatar
7 votes

Cannot convert '#value!" to double

Try this and see if you can find the feature(s) causing the error: lyr = iface.activeLayer() #Click the layer in layer tree error_rows = [] for f in lyr.getFeatures(): try: float(f['...
BERA's user avatar
  • 73.7k
7 votes
Accepted

QGIS custom function error when trying to get color of feature on another layer

After trying it on another Windows machine and playing around with the settings, I found the problem: the color of my polygon was defined as a categorized style with $id as the value to create the ...
Babel's user avatar
  • 71.5k
7 votes
Accepted

'Evaluation error' when using Aggregate tool in QGIS

The string function raised 'Evaluation error' because it couldn't parse the input. To overcome it wrap each of your fields into the to_string() function in the 'Source Expression' and get the output ...
Taras's user avatar
  • 33k
7 votes
Accepted

Feature creation error (OGR error: Coordinates with non-finite values are not allowed)

So I have solved the problem. Maybe my solution can help other people. The problem is in the nan value. If you go into edit mode - click on vertex editor and then right click on the polygon with the ...
Jana_B's user avatar
  • 145
6 votes

How do I address this error message in QGIS, "CSV file must be in UTF-8 encoding"?

Describes use of MMQGIS, a set of Python vector map layer plugins for Quantum GIS MMQGIS assumes that input and output shapefiles and CSV files are encoded in the UTF-8 character set. MMQGIS uses the ...
whyzar's user avatar
  • 12.1k
6 votes

Converting Shapefile to GeoJSON. Both OGR and Mapshaper converters give errors

If a python script is an option for you, then this will do the trick fast: import geopandas as gpd file = gpd.read_file("file.shp") file.to_file("file.json", driver="GeoJSON")
ImanolUr's user avatar
  • 1,100
6 votes

What are duplicate vertices?

Here are the duplicates. Hope this helps. Maybe try that tool also? Have not seen this error before, but it just seems that the error is being generated due to spatially coincident points.
MapHound's user avatar
  • 1,252
6 votes

Self-Contact Topology Errors?

There are quite a few automated tools for checking and repairing geometries in QGIS. The question is - why are they invalid in the first place? It may be helpful to go back upstream to figure out why ...
GISHuman's user avatar
  • 3,691
6 votes
Accepted

Cannot create layer because "unable to open database file" in QGIS 3.2.0?

The easy solution to your issue is to export using the shapefile format instead of the geopackage format. See below if you want to know why you're having this issue. Geopackage is a database format....
csk's user avatar
  • 24.9k
6 votes
Accepted

Earth engine error: Error: Invalid argument: 'image' must be of type Image

You are trying to export an ImageCollection. The MODIS product you are using has daily images, thus there are 29 images in your collection. The export to Drive only allows images, not collections, ...
Kersten's user avatar
  • 9,919
6 votes

MMQGIS Geocode is failing in QGIS 3

I have found the solution. As the error suggests: the SSL in Python is not correctly installed. If you go to /application/python(your version) and then click "Install Certificates.command" ...
Yolanda Dawson's user avatar

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