Opened 15 years ago

Closed 14 years ago

#1977 closed bug (fixed)

spatialite layers disappear when enabling reprojection

Reported by: pcav Owned by: nobody
Priority: major: does not work as expected Milestone: Version 1.4.0
Component: Data Provider Version: Trunk
Keywords: Cc: a.furieri@…
Must Fix for Release: Yes Platform: All
Platform Version: Awaiting user input: no

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

Change History (8)

comment:1 by jef, 15 years ago

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

comment:2 by pcav, 15 years ago

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

comment:3 by lutra, 15 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.

comment:4 by smizuno, 14 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.

comment:5 by lutra, 14 years ago

Must Fix for Release: NoYes
Platform: DebianAll
Priority: minor: annoyancemajor: does not work as expected

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.

comment:6 by lutra, 14 years ago

And it is confirmed also for Postgis layers.

comment:7 by lutra, 14 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.

comment:8 by lutra, 14 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.