Bug report #14524

linestring shapefile with geometry errors disappear from map canvas

Added by aperi2007 - over 4 years ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:22497

Description

We have a line shapefile produced with qgis with some strange issue. When add it to a new empty qgis project and show at full extent it is visible. Instead, when zoom at details it simply disappear.

I never seen this before.

The shapefile is with 1 only records multilinestring. Obtained manually from we with many day of editing work at big details (about 1:2000) and after this dissolved into 1 only geometry with many parts. After this dissolve it work again for some day, where we apply others editing. And yesterdays we dont know we it start to do this strange disappearing at the details level.

The work was done on qgis 2.12 32bit, but it is disappearing also on qgis 2.14 32bit. We use windows 7.

The package has 2 qgis project. The first show the shapefile at full extent and is visible. The second try to show the shapefile at details level and it is not visible.

disappearing-issue.7z - package with 2 qis prj and 1 shp (317 KB) aperi2007 -, 2016-03-17 11:50 PM

new_shapefile_crashing.7z - The new version of the shapefile, that crash qgis when check geom.validity (304 KB) aperi2007 -, 2016-03-18 03:44 AM

History

#1 Updated by Jürgen Fischer over 4 years ago

Does it also happen if you remove the qix (or rebuild it)?

#2 Updated by aperi2007 - over 4 years ago

Yes,
it happen also if removing the .qix.

I dont know how to rebuild it (the qix).

#3 Updated by aperi2007 - over 4 years ago

I try to resolve the issue loading it on spatialite and doing a ST_MAkeValid to resolve all the invalidity of the shapefile.

The spatialite report me that the invalidity are resolved. And after this try to load it on QGIS (2.1) but still it disappear when zoom at detail level.

So I try to analyze it using the QGIS check geometry validity, but when click OK the qgis will crash.

I add this new shapefile to this ticket.

#4 Updated by Maximilian Krambach over 4 years ago

I tried "new_shapefile_crashing" and could check for validity using the python console. The toolbox geometry validity tool did not crash either (qgis 2.14). The shape has 32 self-intersections, one line with less than two points, and 3 duplicate nodes.

The real issue seems to be "invalid geometries are not displayed when zoomed in more than their extend", thus making it impossible to repair them. The crash might be another issue.

#5 Updated by aperi2007 - over 4 years ago

Are you say-ing that qgis dont display an invalid geometry when it is invalid ?

I dont know this

Maximilian Krambach wrote:

I tried "new_shapefile_crashing" and could check for validity using the python console. The toolbox geometry validity tool did not crash either (qgis 2.14). The shape has 32 self-intersections, one line with less than two points, and 3 duplicate nodes.

The real issue seems to be "invalid geometries are not displayed when zoomed in more than their extend", thus making it impossible to repair them. The crash might be another issue.

#6 Updated by Jürgen Fischer over 4 years ago

  • Subject changed from Strange disappearing of a linestrin shapefile geometry to Strange disappearing of a linestring shapefile geometry

#7 Updated by Maximilian Krambach over 4 years ago

When testing with other invalid lines (self intersection, lines with 0 or 1 points), they don't disappear. So I'm unsure now what causes the line to disappear. However, your data give a "Exception: IllegalArgumentException: point array must contain 0 or >1 elements" message in the GEOS log. Maybe this will help someone to find the cause.

To repair your data, you can use the "v.clean" (grass) tool. They wil be multiple lines again, but your work won't be lost.

#8 Updated by aperi2007 - over 4 years ago

Thx for your feedback.
I really appreaciate the time you lost try-ing to be of help for us.

Unfortunatelly we was not able to start the grass from inside our qgis installation.
I'm really embarrassed to be unable to try the solution you (with your time) give us due to another annoying issue in our installations of qgis.
(sometimes qgis is really irritating)

So I cannot verify your solution using Grass tools v.clean.

So we try to resolve the invalidities using other solutions.

A.

Maximilian Krambach wrote:

When testing with other invalid lines (self intersection, lines with 0 or 1 points), they don't disappear. So I'm unsure now what causes the line to disappear. However, your data give a "Exception: IllegalArgumentException: point array must contain 0 or >1 elements" message in the GEOS log. Maybe this will help someone to find the cause.

To repair your data, you can use the "v.clean" (grass) tool. They wil be multiple lines again, but your work won't be lost.

#9 Updated by Maximilian Krambach over 4 years ago

I investigated it further.
The culprit in the shapefile is a (somehow valid) line with a length of < 1e-10 m. The multipart geometry apparently cannot handle this level of detail difference. The shapefile is okay, just the display is off. To "repair" the shapefile, run "multipart to singlepart", then find the offending feature id, delete this feature and proceed with "singlepart to multipart" again.
To find the feature id, you can run a small code snippet on the python console (extensions- python console):

layer = iface.activeLayer()
for feature in layer.getFeatures():
    if feature.geometry().length() < 0.0000000001: 
        print feature.id()

#10 Updated by Giovanni Manghi over 4 years ago

  • Status changed from Open to Feedback

where do we stand with this issue?

#11 Updated by Giovanni Manghi over 4 years ago

sorry for asking asking again, what is the status of this issue? Has the reporter made more tests?

#12 Updated by Giovanni Manghi over 4 years ago

  • Subject changed from Strange disappearing of a linestring shapefile geometry to linestring shapefile with geometry errors disappear from map canvas
  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.14.0 to master

Other software is affected (ex: OpenJump), other no (ex: gvSIG).

It seems that the crash while checking the layer with the QGIS tool is gone in the latest releases.

Also cleaning with Processing/GRASS produces a working vector.

It would be anyway good to at least ẁarn the users about what is going on with such vectors.

#13 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No
  • Regression? set to No

#14 Updated by Giovanni Manghi over 1 year ago

  • Status changed from Open to Closed
  • Resolution set to end of life

Also available in: Atom PDF