Bug report #1977
spatialite layers disappear when enabling reprojection
|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|
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
#4 Updated by Steven Mizuno almost 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.
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.