opengisch / QField

A simplified touch optimized interface for QGIS
http://www.qfield.org
GNU General Public License v2.0
765 stars 215 forks source link

Symbology geometry generator: Index missmatch #5430

Open vincentBenet opened 1 week ago

vincentBenet commented 1 week ago

Describe the issue

On Qgis on a layer, I am using symbology based on the ID of another layer with geometry generator line to make a line based on the ID point of the other layer.

On Qgis this is working well, but on Qfield, the line is going somewhere else (this is OK on only few points)

Reproduction steps

Steps to reproduce the behavior:

  1. Create a first layer named 'sites' of points and place few points.
  2. Create a second layer of linestring geometry with an attribute id_site and place few lines with attribute based on ID of first layer.
  3. On the second layer add on symbology a geometry generator line with following formulla: make_line($geometry, geometry(get_feature_by_id('sites', "id_site"))

Expected behavior

  1. On Qgis you have a line that goes to the corresponding id_site
  2. Load the project on Qfield and you should have same lines

Observed behavior

  1. On Qfield, some lines are not going to the correct id_site, it has changed compared to QGIS.

Screenshots and GIFs

Screenshot_20240707_104634

Desktop (please complete the following information)

Mobile (please complete the following information)

[If the problem happened with QFieldCloud, please add your username and project name.] Custom Qfieldcloud server from fresh build, I can create username if needed

m-kuhn commented 1 week ago

Can you try with the layer name instead of id?

vincentBenet commented 1 week ago

Can you try with the layer name instead of id?

No, I am using the function get_feature_by_id('sites', "id_site"), but the layer name is included in it.

nirvn commented 1 week ago

@vincentBenet , if possible, we'd benefit from having a sample project with data that already show the discrepancy between QGIS and QField.

vincentBenet commented 1 week ago

@nirvn here it is:

Project: peche.zip

Qfield on computer: image

Qfield on phone: WhatsApp Image 2024-07-08 à 09 21 49_f5f6bc7e

QGIS: image

As you observe, on the spot 11, the red arrow line linking acces layer to the spot is not going at the right index on the phone.

Please take in note, that I am using QfieldCloud to transfert project to my phone, this maybe a root source problem...