Bug report #1977

spatialite layers disappear when enabling reprojection

Added by Paolo Cavallini about 10 years ago. Updated almost 10 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12037

Description

Load a SpatiaLite layer; enable on the fly reprojection; the layer is no longer shown on the canvas. If you load it again, all ok

History

#1 Updated by Jürgen Fischer about 10 years ago

not reproducable here. Are you projecting to the same CRS your data is in?

#2 Updated by Paolo Cavallini about 10 years ago

Right - if I do the same in a different projection, this does not appear.

#3 Updated by Giovanni Manghi about 10 years ago

I confirm the behaviour with qgis trunk and ubuntu 9.04.

The weird thing is that if OTFR is enabled before (regardless of the CRS) adding the spatialite layer, then it goes everything ok. If is enabled after adding it, then it disappears.

#4 Updated by Steven Mizuno about 10 years ago

I have also noticed this problem. In QgsSpatiaLiteProvider::select() near the bottom of the function (about line 592) the valid variable is set false on a failed database request. This may occur if the extent requested is out of bounds for the layer's CRS.

Once valid is false the provider won't return any data.

I believe the valid variable should NOT be set false just because there is an error in the current database request.

I believe #2047 is another manifestation of this.

#5 Updated by Giovanni Manghi almost 10 years ago

This is still confirmed and I (only) now noticed that this is the same identical problem that we have now also with shapefiles (until a few days ago with shapefiles worked ok). See #2148.

Resuming:

Add a layer then enable OTFR and choose a crs for the project.

1) If the layer crs is equal to the project crs, than is all ok

2) if the layer crs is different from the project crs than it doesn't show in map canvas

You may also want to try this:

Open a new project, enable OTFR, choose a crs for project and then add a layer

1) Even if the project crs is different from the layer crs it seems to work fine, but...

2) If you then choose another crs for the project (different from the layer crs), then again the layer will not show in map canvas.

I will test also postgis and then repost back.

#6 Updated by Giovanni Manghi almost 10 years ago

And it is confirmed also for Postgis layers.

#7 Updated by Giovanni Manghi almost 10 years ago

Well it seems to me that this is no more a data provider problem but instead a projection one. Please not that until a few days ago shapes and postgis worked fine.

I believe that one among #1977 and #2148 can be closed as duplicate.

#8 Updated by Giovanni Manghi almost 10 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

The fix for #2148 fixed also this one. Thanks.

Also available in: Atom PDF