Bug report #4396

(fTools) - Check geometry Validity raises exception clicking on errors with no coordinates

Added by Luca Sigfrido Percich about 8 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/QGIS
Affected QGIS version:master Regression?:
Operating System:all Easy fix?:
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:14328

Description

Using the "Check Geometry Validity" in fTools, the user is presented a Dialog with the list of error messages and possibly the corresponding coordinates.

When clickion on error lines like the following, the location of the error is shown on map:

15622,segments 0 and 11 of line 0 intersect at 1506841.69141, 5033355.60175
20415,line 0 contains 1 duplicate node(s) at 14

but with the following error description (which does not contain a coordinate pair or vertex reference):
7607,Unknown geometry type

the following exception is being raised:

An error has occured while executing Python code:

Traceback (most recent call last):
File "/home/sigfrido/.qgis/python/plugins/fTools/tools/doValidate.py", line 97, in zoomToError
x = item.data(Qt.UserRole).toPyObject().x()
AttributeError: 'NoneType' object has no attribute 'x'

I'm using fTools 0.6.1 on QGis 1.71, Ubuntu 10.04

fTools_pg_test_nullgeom.sql - PostGIS SQL script for creating a table with null geometries (430 Bytes) Luca Sigfrido Percich, 2011-11-13 09:36 AM

Associated revisions

Revision a442b89c
Added by Jürgen Fischer over 7 years ago

fTools: fix handling of locationless geometry errors (fixes #4396)

History

#1 Updated by Tim Sutton about 8 years ago

  • Target version changed from Version 1.7.1 to Version 1.7.2

#2 Updated by Alexander Bruy about 8 years ago

Please provide sample dataset

#3 Updated by Luca Sigfrido Percich about 8 years ago

The absence of coordinates in the error message was due to the PostGIS geometries being NULL.

I attach a simple script for creating a postGIS layer with two records with null geometry.
You can reproduce the problem adding the layer in QGIS as a Multipolygon layer and running the "Check geometry validity" on it.

Sorry for having not done this before, next time I'll try to be more precise and immediately add test data to the ticket.

#4 Updated by Giovanni Manghi almost 8 years ago

  • Target version changed from Version 1.7.2 to Version 1.7.3

#5 Updated by Giovanni Manghi almost 8 years ago

  • Target version changed from Version 1.7.3 to Version 1.7.4

#6 Updated by Giovanni Manghi over 7 years ago

  • Target version changed from Version 1.7.4 to Version 2.0.0

#7 Updated by Alexander Bruy over 7 years ago

  • Tracker changed from Feature request to Bug report
  • Crashes QGIS or corrupts data set to No
  • Affected QGIS version set to master

#8 Updated by Alexander Bruy over 7 years ago

  • Assignee deleted (cfarmer -)
  • Operating System set to all

Seems after refactoring of the QgsGeometryAnalyzer this not true. Check geometry validity now returns nothing (no errors) on this sample data. For me this ticket now part of more general issue with Check geometry validity, see #5070

#9 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Open to Feedback

#10 Updated by Jürgen Fischer over 7 years ago

  • Status changed from Feedback to Closed

#11 Updated by Giovanni Manghi over 2 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF