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.04k stars 2.92k forks source link

More user friendly handling of geometryless tables and layers loaded by a query with no matching features #14220

Open qgib opened 12 years ago

qgib commented 12 years ago

Author Name: Alister Hood (@AlisterH) Original Redmine Issue: 4281

Redmine category:vectors


When adding a WFS layer with the option "only request features overlapping the current view extent", if there are no features in the current map extent, the layer is added, and looks like the top layer in the attached part of a screenshot. On the symbology tab of the layer properties, the top row of the old symbology options is shown (legend type, single symbol, transparency, new symbology button). If you click the new symbology button, the dialog switches to the labels tab. The symbology tab behaviour is the same with geometryless tables (e.g. try with the layers stored in ~/.qgis/qgis.db). I think the same things can occur with other layer types which can be loaded with a query (postgis, spatialite...)

1) Maybe it would be possible when loading a layer with a query, to detect if there are no features, and provide a message telling the user that there are none. (But a user might want to load an empty layer and add some features, so if the layer is writable, I guess the user should have a choice to load it...)

2) It would probably be less confusing if the symbology tab was not shown for a geometryless table.


qgib commented 12 years ago

Author Name: Anita Graser (@anitagraser)


qgib commented 12 years ago

Author Name: Alister Hood (@AlisterH)


2) It would probably be less confusing if the symbology tab was not shown for a geometryless table.

Also, the CRS and extent related features should ideally be disabled (greyed-out or something) or hidden for geometry-free tables. e.g. in the layer right click menu: "Set layer CRS", "Set project CRS from layer", and on the layer properties General tab, "Specify CRS", and on the Metadata tab "Extents" and "Layer Spatial Reference System".

qgib commented 11 years ago

Author Name: Pirmin Kalberer (Pirmin Kalberer)


qgib commented 8 years ago

Author Name: Médéric RIBREUX (Médéric RIBREUX)


Hello, bug triage...

I think there is a difference between geometryless tables and an empty layers in QGIS now.

For geometryless tables, QGIS now disable the Style tab which is good (try with a CSV or a simple SQLite table) and answers to a part of your request. The CRS selection is still enabled and it should be disabled at all following this feature request.

When you add an empty table, QGIS tries to determine the geometry type and set a default style for this (Simple Fill for polygons). For WFS, the geometry type is detected from the request answer of the WFS Server. For PostGIS layers (even for views or queries), the geometry type is detected from metadata views. For Oracle, QGIS asks to the user what is the geometry type of the layer. For those empty layers, QGIS displays a Style tab and this coherent with the fact that this is a geometry table with no feature. In the recent versions of QGIS, an empty WFS layer is not detected as a geometryless table but an empty geometry table which is better that the situation you related.

So, to answer totally to this feature request we need to:


qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 5 years ago

Author Name: Alister Hood (@AlisterH)


Médéric RIBREUX wrote: ...

So, to answer totally to this feature request we need to:

  • Display a message when user opens an empty layer (with geometry column in it or not).

i.e. as per 1 in the description.

  • Disable CRS selection for geometryless tables.

This seems to be implemented in recent versions of QGIS, but there is still CRS and extent functionality on the "Metadata>extent" tab (which is partially functional, even though you can choose the CRS you want!), which doesn't really make sense.


1) Maybe it would be possible when loading a layer with a query, to detect if there are no features, and provide a message telling the user that there are none. (But a user might want to load an empty layer and add some features, so if the layer is writable, I guess the user should have a choice to load it...)

2) It would probably be less confusing if the symbology tab was not shown for a geometryless table. to When adding a WFS layer with the option "only request features overlapping the current view extent", if there are no features in the current map extent, the layer is added, and looks like the top layer in the attached part of a screenshot. On the symbology tab of the layer properties, the top row of the old symbology options is shown (legend type, single symbol, transparency, new symbology button). If you click the new symbology button, the dialog switches to the labels tab. The symbology tab behaviour is the same with geometryless tables (e.g. try with the layers stored in ~/.qgis/qgis.db). I think the same things can occur with other layer types which can be loaded with a query (postgis, spatialite...)

1) Maybe it would be possible when loading a layer with a query, to detect if there are no features, and provide a message telling the user that there are none. (But a user might want to load an empty layer and add some features, so if the layer is writable, I guess the user should have a choice to load it...)

2) It would probably be less confusing if the symbology tab was not shown for a geometryless table.