Feature request #4281

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

Added by Alister Hood about 13 years ago. Updated almost 6 years ago.

Status:In Progress
Priority:Low
Assignee:-
Category:Vectors
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:14220

Description

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.

untitled.PNG (2.5 KB) Alister Hood, 2011-09-12 08:19 PM

History

#1 Updated by Anita Graser about 13 years ago

  • Target version set to Version 2.0.0

#2 Updated by Alister Hood about 13 years ago

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".

#3 Updated by Pirmin Kalberer about 12 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

#4 Updated by Médéric RIBREUX almost 9 years ago

  • Status changed from Open to In Progress
  • % Done changed from 0 to 50

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:

- Display a message when user opens an empty layer (with geometry column in it or not).
- Disable CRS selection for geometryless tables.

#5 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

#6 Updated by Alister Hood almost 6 years ago

  • Description updated (diff)

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.

Also available in: Atom PDF