Bug report #17551

(daily build cd0ba91) virtual layer queries seem to be broken

Added by Lars Kellogg-Stedman over 2 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Virtual Layers
Affected QGIS version:master Regression?:Yes
Operating System:linux (ubuntu xenial) Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:Yes Copied to github as #:25448

Description

I am trying to use the "virtual layers" feature in QGIS (daily build cd0ba91) to select a list of towns adjacent to a specific town using data from MassGIS. The source data is the "Mass. Cities and Towns" dataset from the MassGIS WFS server, using CRS EPSG:26986. I load this into a layer called "town".

Next, I select "Layer -> Add Layer -> Add/Edit Virtual Layer..." and use the following query:

SELECT b.town_id as town_id, b.town as town, b.geometry as geometry
FROM towns AS a JOIN towns AS b
WHERE a.town = "BELMONT" AND st_touches(a.geometry, b.geometry)

I click "add", and then layer shows up as expected. At this point, if I move/zoom the map canvas or attempt to open the attribute table, qgis gets stuck. The "virtual layers" feature seems extraordinarily useful if only it would work :).

I'm running the nightly build on Ubuntu Xenial (with all the dependencies up-to-date: e.g., running an apt-get update/apt-get upgrade before installing qgis).

History

#1 Updated by Giovanni Manghi over 2 years ago

  • Status changed from Open to Feedback

Did you tagged as regression because the query (with the same data) works on 2.18.14?

#2 Updated by Lars Kellogg-Stedman over 2 years ago

Giovanni Manghi wrote:

Did you tagged as regression because the query (with the same data) works on 2.18.14?

Yes, that's correct. With 2.18.14 the exact same operation works fine, and I can continue interacting with qgis.

#3 Updated by Giovanni Manghi over 2 years ago

  • Status changed from Feedback to Open
  • Priority changed from Normal to High

#4 Updated by Sandro Santilli over 2 years ago

  • Assignee set to Sandro Santilli
  • Status changed from Open to Feedback

Lars can you attach or provide a link to download the input datasource ? Your query seems to be expensive, how much does it take to complete from commandline (taking qgis out of the picture) ?

#5 Updated by Lars Kellogg-Stedman over 2 years ago

Sandro Santilli wrote:

Lars can you attach or provide a link to download the input datasource ?

Sandro, sorry for the slow response. The email notification about your comment got mis-filtered. Let me see whether or not this still reproduces with the current daily build.

#6 Updated by Lars Kellogg-Stedman over 2 years ago

Sandro Santilli wrote:

Lars can you attach or provide a link to download the input datasource ? Your query seems to be expensive, how much does it take to complete from commandline (taking qgis out of the picture) ?

The data source I'm using is (this is the "URI" field from the "Properties..." dialog associated with the layer in the WFS listing):

restrictToRequestBBOX='1' srsname='EPSG:26986' typename='massgis:GISDATA.TOWNS_POLY_TRANSP_EDU' url='http://giswebservices.massgis.state.ma.us/geoserver/wfs' version='1.0.0' version='1.0.0' table="" sql=

There are only 351 features in that data source.

The procedure:

1. select that layer
2. select "Add selected layer(s) to canvas"
3. rename the new layer to "towns"
4. hide the layer (uncheck the checkbox next to it in the layer list)
5. select "add/edit virtual layer"
6. enter the query (see original report) into the "query" field
7. click "add"
8. close the "add/edit virtual layer" window

...and now, if I zoom the canvas so that the layer ends up off the visible area, qgis gets wedged somehow.

I've recorded a demonstration and made it available at https://youtu.be/3_YdztSUGKo

#7 Updated by Sandro Santilli over 2 years ago

Connecting to WFS service http://giswebservices.massgis.state.ma.us/geoserver/wfs now does not give massgis:GISDATA.TOWNS_POLY_TRANSP_EDU as a layer option. Ido see a massgis:TOWN_POLYM_SHP and massgis:GISDATA.TOWNS_POLY_AREACODE (non spatial). Selecting massgis:TOWN_POLYM_SHP and adding to canvas doesn't show anythingon the map

#8 Updated by Lars Kellogg-Stedman over 2 years ago

You can see me select the layer right there in the youtube video. If the information that qgis is providing in the "properties" window is incorrect, maybe that's a different bug.

I've run into a similar performance difference between the release and the latest nightly when using postgis data sources as well (using the current release, clicking on a feature with the "info" point returns information instantly; using the nightly it takes upwards of 30 seconds while consuming lots of CPU time).

Unfortunately, all the data sources I'm using seem to be hard to share (local postgis sources, and WFS layers that load fine for me but using the information that qgis gives me seem to be unavailable to you). I'm not sure how to move this forward. I'd like to see the problem fixed, because if I'm hitting while just playing around with toy data, I can't imagine what the impact would be on someone trying to use larger data sets.

#9 Updated by Sandro Santilli over 2 years ago

Could you try attaching a projectfile nontheless, just with the WFS layer in it ? The PostGIS layer is not required for reproducing the bug, is it ? I can try creating the virtual layer locally.
Also a question: does this getting stuck only happens when having that additional WFS layer ? Does it still happen if the WFS layer is turned to invisible/inactive before adding the virtual layer ?

#10 Updated by Sandro Santilli over 2 years ago

  • Assignee deleted (Sandro Santilli)

#11 Updated by Nyall Dawson over 2 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

Closing due to lack of feedback

Also available in: Atom PDF