qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.37k stars 2.98k forks source link

Virtual layer behaviour with null values #53333

Open Redoute opened 1 year ago

Redoute commented 1 year ago

What is the bug or the crash?

A virtual layer stumbles at missing geometries. The example tries to define 10 points via Excel table. Only 5 of them are displayed, because the 6th one has no values for x and y. The attribute table shows all 10 cases, and one can select the hidden ones and pan to their location, but for example an export as Geopackage saves only the visible 5 points.

vlayer.zip points.xlsx

Steps to reproduce the issue

See attached example - rename vlayer.zip to vlayer.qgz.

Versions

QGIS version 3.28.4-Firenze QGIS code revision fd0fb72ab3 Qt version 5.15.3 Python version 3.9.5 GDAL/OGR version 3.6.2 PROJ version 9.1.1 EPSG Registry database version v10.076 (2022-08-31) GEOS version 3.11.1-CAPI-1.17.1 SQLite version 3.39.4 PDAL version 2.4.3 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.13.1 OS version Windows 10 Version 2009

Active Python plugins latlontools 3.6.10 nominatim 1.4.5 QuickOSM 2.2.2 db_manager 0.1.20 grassprovider 2.12.99 MetaSearch 0.3.6 processing 2.12.99 sagaprovider 2.12.99

Supported QGIS version

New profile

Additional context

No response

agiudiceandrea commented 1 year ago

@Redoute, I can partially confirm the reported issue. The vritual layer created with the query:

SELECT id, x, y, make_point(x, y) AS geom /*:point:4326*/
    FROM points;

does actually incorrectly display only 5 points, while the attribute table lists 10 records, 9 of which have non null coordinates.

Anyway, it seems to me it is not possible to pan to non displayed features as the following errors are thrown: Pan to feature id failed : Feature not found (using the "Pan to Feature" contextual menu action) or Cannot pan to selected feature(s) : No extent could be determined. (using the "Pan map to the selected rows" button or the "Pan Map to Selection" buttons).