Bug report #15507
QGIS crashes with GEOS Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4
|Affected QGIS version:||2.18.7||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||Yes||Copied to github as #:||23431|
The problem has also been encountered in the mailing list https://lists.osgeo.org/pipermail/qgis-developer/2016-May/042692.html
QGIS simply crashes in some projects that have specific geometry although I tested the geometry validity and it's all good.
The error is:
src/core/qgsmessagelog.cpp: 45: (logMessage) [0ms] [thread:0x605ec20] 2016-08-31T21:44:39 GEOS Exception: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4 src/core/geometry/qgsgeos.cpp: 63: (throwGEOSException) [0ms] [thread:0x605ec20] GEOS exception: IllegalArgumentException: RobustDeterminant encountered non-finite numbers
The problem was tested under Spatialite and under Postgis.
I've turned feature simplification off in QGIS to no avail.
I've attached data and you can replicate by taking the following steps:
- Open the project
- Change the CRS from 4326 to 3857 (web mercator)
Depending on the styling/labeling, it may not crash.
I can replicate under QGIS 2.14.6 and 2.16.2
#1 Updated by Jukka Rahkonen about 5 years ago
Source data contains vertices like POINT (25.714286 -90)which are outside the valid area for EPSG:3857 which is "World between 85.06°S and 85.06°N." http://epsg.io/3857. I guess that latitude -90 leads to divide by zero error and it just can't work.
Crash is not the best thing to happen but how to prevent it and throw an error instead?
#2 Updated by Giovanni Manghi over 4 years ago
- Category set to Projection Support
- Priority changed from Normal to High
- Target version set to Version 2.18
- Affected QGIS version changed from 2.14.5 to 2.18.4
- Crashes QGIS or corrupts data changed from No to Yes
- Operating System deleted (
#9 Updated by Sandro Santilli over 4 years ago
- Status changed from Closed to Reopened
I'm reopening to get this also fixed in the master branch, where the crash is not present but the features disappear from the map completely instead, logging the "IllegalArgumentException: Invalid number of points in LinearRing found" message.
#11 Updated by Sandro Santilli over 4 years ago
- Status changed from Reopened to Closed
- Resolution set to fixed/implemented
Actually, as the crash is fixed, I'm closing this again.
It's better to have a separate issue for the lack of GUI error message (is an enhancement)
and for the rendering issue (it's not a crash).