18

I have two shapefile layers in a QGIS project that have problems with zooming. One is a line I copied/pasted in a new layer from a set of height contours and the other one is a polygon layer I created by dissolving all features in another layer.

In both cases, the layers won't display unless the entirety of the layer shows in the canvas. When I zoom in or drag the view, as soon as part of the layer is out of the canvas the entire layer disappears.

In the case of the polygon layer, if I delete it and generate it again it works properly, but when I start filling the rings it reaches a point when it stops working well (I want to end up with a single polygon enclosing all features in the original layer). I guess it must have to do with the geometry of the layer, but I haven't found the cause.

Both layers previously worked well, and removing them/adding them again doesn't fix the issue.

All other layers in the project work well (including the set of height contours and the polygons layer I used to generate the troublesome layers).

This issue has shown in both QGIS 2.4 and 2.6

Is there anything I'm doing wrong?

GforGIS
  • 3,126
  • 3
  • 19
  • 38
JPH
  • 181
  • 1
  • 1
  • 4

9 Answers9

10

I had the same problem. In my case, the problematic shapefile had been created by ArcGIS. I fixed it by removing the useless extra files ESRI add to shapefiles (.cpg, .qpj, .sbx, and .shp.xml) keeping only the usefull ones (.dbf, .shp, .prj, .shx). Et voilĂ !

Bastien
  • 637
  • 4
  • 15
9

My coworkers and I were all having this problem in versions of QGIS that range from 2.6.1 to the new 2.14. The solution we worked out is to run:

Vector > Geometry Tools > Multiparts to Singlepart...

The new shapefile produced will now render at all zoom levels. I believe the issue is that the old shapefile had an incorrect ring order (presuming your file had internal rings) and the fix is therefore similar to running "Repair Geometry" in ArcMap.

4

I was having the same problem. What solved it for me was using both what RickOrth said and what Vince said.

From the Layer>Properties>General Set the Coordinate reference system from a USER: to the correct system. Then click Create spatial index.

2

Presuming you don't have scale dependent visibility set in the properties window...

I use GRASS for data cleaning, if you need to fill holes and undertake other topology work v.clean is a very good place to start.

MikeRSpencer
  • 972
  • 6
  • 12
1

Check that the Coordinate reference system value under Layer Properties is set correctly. I have seen shapefiles with valid prj files reset this value to a Generated CRS(...) USER:10000x. This generated CRS can cause data to disappear in the same way data with no CRS set.

RickOrth
  • 41
  • 4
1

My problem was that I had imported a .csv that had some NaNs in the Eastings/Northings. These got replaced with 1s. Once I got rid of those I had no problem.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Katie W
  • 19
  • 2
0

I have had this problem before too, especially when importing .shp files to a SpatialLite database. I found that a very simple way to fix it is to select every feature, turn on editor, use the Move feature tool, then simply click and release. You don't actually move any features but it forces the program to rewrite every vertex, and somehow, after this the geometry is fixed. It can take a while for large files but it has been sure fire for me.

nsm91
  • 135
  • 1
  • 8
0

I tried all the solutions presented here for a similar problem I had with a part of a polygon that disappeared when I zoomed in. The only one that worked for me was using v.clean from the processing toolbox with the rmdupl option and the tolerance set to 0. This removes all the duplicate nodes and gives a topologically correct file.

geotyr
  • 426
  • 2
  • 11
0

Using the 'Fix Geometries' tool solved this problem for me.

Erioderma
  • 535
  • 2
  • 9