lizmap-web-client icon indicating copy to clipboard operation
lizmap-web-client copied to clipboard

Wrong behaviour of selection tools with layer with primary key column of type int8

Open RobiFag opened this issue 4 years ago • 7 comments

What is the bug?

I have a project with two identical PostgreSQL/PostGIS layers (geometry PointZ and CRS 7791). The former, which is a copy of the second one, has a primary key column (named id_punti) of type int4 and the later has the same primary key column (named id_punti) but of type int8. The selection tool works correctly with the first layer (primary key int4) but has a wrong behaviour with the second layer (primary key int8). When I try to select some point, the tool highlights random points and not those specified with the selection instrument (I tried all tools circle, rectangle, etc. ). The highlighted rows in the attribute table are correct and also the filter works fine but the geometries in the map are not correctly highlighted.

Screenshots and logs

issue_selection

Environment

  • Lizmap version: 3.3.8
  • QGIS Server FULL version: 3.10.8
  • QGIS Desktop FULL version: 3.10.8
  • OS (Windows, Linux, MacOS, Android…): Windows 10
  • Browser (Firefox, Chrome…): Chrome and Firefox

RobiFag avatar Aug 04 '20 14:08 RobiFag

This is a known problem. But AFAIK, this bug is upstream to QGIS Server and not related to Lizmap. I wanted to have a check in Lizmap-Plugin.

I think I heard some news about this from @rldhont, maybe I'm wrong.

Gustry avatar Aug 05 '20 06:08 Gustry

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎

3liz-bot avatar Sep 08 '20 04:09 3liz-bot

This issue is missing some feedbacks. 👻 Please have a look to the discussion, thanks. 🦎

3liz-bot avatar Oct 09 '20 04:10 3liz-bot

It seems still valid, unless it has been resolved upstream. Please add here the reference to the ticket upstream for reference. After that I balieve this one can be closed.

pcav avatar Oct 09 '20 06:10 pcav

It's a QGIS Server issue. The FeatureID has to be an int4, if the primary key is not an int4, QGIS creates a join table between the FeatureID as an int4 and the primary key, but each QGIS Server creates its own join table and adds primary key values in the order they are facing it.

We try to fix it by providing in WFS and WMS FEATRUEID as the primary key.

rldhont avatar Oct 19 '20 08:10 rldhont

So to avoid this issue in the mean time (before a fix in QGIS Server upstream)

  • PostgreSQL layer : Int4 or serial only, no Int8
  • Any other provider are fines with Int8
  • Add a check in Lizmap plugin to warn this

Gustry avatar Oct 19 '20 08:10 Gustry

@Gustry I just found a client getting this issue. We could take some paid support time to Add a check in Lizmap plugin to warn this?

Ref: support 1963

nboisteault avatar May 18 '22 09:05 nboisteault

The plugin is already warning about int8 fields, from https://github.com/3liz/lizmap-plugin/issues/389 It's not a issue in Lizmap Web Client, but in QGIS server.

Gustry avatar Jul 18 '23 15:07 Gustry